diff --git a/src/npc/asDump.tw b/src/npc/asDump.tw
index 34ddb96fb6faffedef817cdb518ca2e35c1de2ba..859039ff36af09af7815273b7b957ee474f7ab65 100644
--- a/src/npc/asDump.tw
+++ b/src/npc/asDump.tw
@@ -15,8 +15,8 @@
 	<<if $i >= 0 && $i < _SL && $slaves[$i].ID == _ID>> /* shortcut if $i is already pointing to this slave */
 		<<set $slaves[$i] = $activeSlave>>
 	<<else>>
-		<<set $i = $slaves.findIndex(function(s) { return s.ID == _ID; })>> /* find $i if exists */
-		<<if $i == -1>> /* not found, so new slave */
+		<<set $i = $slaveIndices[_ID]>> /* find $i if exists */
+		<<if ndef $i>> /* not found, so new slave */
 			<<AddSlave $activeSlave>>
 		<<else>>
 			<<set $slaves[$i] = $activeSlave>>
diff --git a/src/npc/rgASDump.tw b/src/npc/rgASDump.tw
index 0b3a6b42ad9ab8fa50d60c1297b0266cfb5dcf94..610026fd8b97d96dd6559a7561c9d66eee2b8960 100644
--- a/src/npc/rgASDump.tw
+++ b/src/npc/rgASDump.tw
@@ -103,10 +103,8 @@
 	<<set $careerBonusApplied = 1>>
 <</if>>
 
-<<for _i = 0; _i < _SL; _i++>>
-	<<if _ID == $slaves[_i].ID>><<break>><</if>>
-<</for>>
-<<if _i < _SL>>
+<<set _i = $slaveIndices[_ID]>>
+<<if def _i>>
 	<<set $slaves[_i] = $activeSlave>>
 <<elseif def $activeSlave.slaveName>>
 	<<AddSlave $activeSlave>>
diff --git a/src/uncategorized/RECI.tw b/src/uncategorized/RECI.tw
index efd48750644a1b69e6bb1617a4e67592077671ed..3180948ae84e2726cd06f8f2db4a9534b51c9682 100644
--- a/src/uncategorized/RECI.tw
+++ b/src/uncategorized/RECI.tw
@@ -300,19 +300,11 @@ She looks pensive, and goes through two false starts before she clears her throa
 	"@@.hotpink;That wa<<s>> fun,@@ <<Master>>!" she <<say>>s. "<<Sh>>all we flip her over and go again?" 
 	<<Enunciate $activeSlave>>
 	"@@.hotpink;Plea<<s>>e nooo,@@" comes a quiet wail from the floor.
-	<<set $activeSlave.devotion += 2>>
-	<<set $activeSlave.analCount += 1>>
-	<<set $analTotal += 1>>
-	<<set $activeSlave.oralCount += 1>>
-	<<set $oralTotal += 1>>
-	<<for $i = 0; $i < $slaves.length; $i++>>
-		<<if $slaves[$i].ID == $HeadGirl.ID>>
-		<<set $slaves[$i].devotion += 2>>
-		<<set $activeSlave.penetrativeCount += 1>>
-		<<set $penetrativeTotal += 1>>
-		<<break>>
-		<</if>>
-	<</for>>
+	<<set $activeSlave.devotion += 2, $activeSlave.analCount += 1, $activeSlave.oralCount += 1>>
+	<<set $analTotal += 1, $oralTotal += 1>>
+	<<set $HeadGirl.devotion += 2, $HeadGirl.penetrativeCount += 1>>
+	<<set $penetrativeTotal += 1>>
+	<<set $slaves[$slaveIndices[$HeadGirl.ID]] = $HeadGirl>>
 	<</replace>>
 <</link>>
 <</if>>
@@ -338,19 +330,11 @@ She looks pensive, and goes through two false starts before she clears her throa
 	"@@.hotpink;That wa<<s>> fun,@@ <<Master>>!" she <<say>>s. "<<Sh>>all we flip her over and go again?" 
 	<<Enunciate $activeSlave>>
 	"@@.hotpink;Plea<<s>>e nooo,@@" comes a quiet wail from the floor.
-	<<set $activeSlave.devotion += 2>>
-	<<set $activeSlave.analCount += 1>>
-	<<set $analTotal += 1>>
-	<<set $activeSlave.oralCount += 1>>
-	<<set $oralTotal += 1>>
-	<<for $i = 0; $i < $slaves.length; $i++>>
-		<<if $slaves[$i].ID == $Concubine.ID>>
-		<<set $slaves[$i].devotion += 2>>
-		<<set $activeSlave.penetrativeCount += 1>>
-		<<set $penetrativeTotal += 1>>
-		<<break>>
-		<</if>>
-	<</for>>
+	<<set $activeSlave.devotion += 2, $activeSlave.analCount += 1, $activeSlave.oralCount += 1>>
+	<<set $analTotal += 1, $oralTotal += 1>>
+	<<set $Concubine.devotion += 2, $Concubine.penetrativeCount += 1>>
+	<<set $penetrativeTotal += 1>>
+	<<set $slaves[$slaveIndices[$Concubine.ID]] = $Concubine>>
 	<</replace>>
 <</link>>
 <</if>>
@@ -420,7 +404,6 @@ She looks pensive, and goes through two false starts before she clears her throa
 	<<if $activeSlave.vagina > -1>>
 		<<set $activeSlave.vaginalCount += 1>>
 		<<set $vaginalCount += 1>>
-	<<else>>
 	<</if>>
 	<</replace>>
 <</link>>
diff --git a/src/uncategorized/RETS.tw b/src/uncategorized/RETS.tw
index 402b29e246b1f56c279c9b340d1d1902ac70edf2..9ac6bee0ec256ea1e58a963d7db7080c85ac2761 100644
--- a/src/uncategorized/RETS.tw
+++ b/src/uncategorized/RETS.tw
@@ -49,7 +49,7 @@
 	<<set $RETasteTestSubIDs = $RETasteTestSubIDs.shuffle()>>
 	<<for $i = 0; $i < $RETasteTestSubIDs.length; $i++>>
 		<<if $eventSlave.ID != $RETasteTestSubIDs[$i]>>
-			<<set $subSlave = $slaves.find(function(s) { return s.ID == $RETasteTestSubIDs[$i]; })>>
+			<<set $subSlave = $slaves[$slaveIndices[$RETasteTestSubIDs[$i]]]>>
 			<<break>>
 		<</if>>
 	<</for>>
@@ -57,7 +57,7 @@
 
 <<case "date please">>
 
-<<set $subSlave = $slaves.find(function(s) { return s.ID == $eventSlave.relationshipTarget; })>>
+<<set $subSlave = $slaves[$slaveIndices[$eventSlave.relationshipTarget]]>>
 
 <<case "anal cowgirl">>
 
@@ -65,7 +65,7 @@
 	<<set $REAnalCowgirlSubIDs = $REAnalCowgirlSubIDs.shuffle()>>
 	<<for $i = 0; $i < $REAnalCowgirlSubIDs.length; $i++>>
 		<<if $eventSlave.ID != $REAnalCowgirlSubIDs[$i]>>
-			<<set $subSlave = $slaves.find(function(s) { return s.ID == $REAnalCowgirlSubIDs[$i]; })>>
+			<<set $subSlave = $slaves[$slaveIndices[$REAnalCowgirlSubIDs[$i]]]>>
 			<<break>>
 		<</if>>
 	<</for>>
@@ -77,7 +77,7 @@
 	<<set $REBoobCollisionSubIDs = $REBoobCollisionSubIDs.shuffle()>>
 	<<for $i = 0; $i < $REBoobCollisionSubIDs.length; $i++>>
 		<<if $eventSlave.ID != $REBoobCollisionSubIDs[$i]>>
-			<<set $subSlave = $slaves.find(function(s) { return s.ID == $REBoobCollisionSubIDs[$i]; })>>
+			<<set $subSlave = $slaves[$slaveIndices[$REBoobCollisionSubIDs[$i]]]>>
 			<<break>>
 		<</if>>
 	<</for>>
@@ -87,42 +87,39 @@
 
 <<if Array.isArray($REIfYouEnjoyItSubIDs)>>
 	<<set $REIfYouEnjoyItSubIDs = $REIfYouEnjoyItSubIDs.random()>>
-	<<set $subSlave = $slaves.find(function(s) { return s.ID == $REIfYouEnjoyItSubIDs; })>>
+	<<set $subSlave = $slaves[$slaveIndices[$REIfYouEnjoyItSubIDs]]>>
 <</if>>
 
 <<case "sadistic description">>
 
 <<if Array.isArray($RESadisticDescriptionSubIDs)>>
 	<<set $RESadisticDescriptionSubIDs = $RESadisticDescriptionSubIDs.random()>>
-	<<set $subSlave = $slaves.find(function(s) { return s.ID == $RESadisticDescriptionSubIDs; })>>
+	<<set $subSlave = $slaves[$slaveIndices[$RESadisticDescriptionSubIDs]]>>
 <</if>>
 
 <<case "shower force">>
 
 <<if Array.isArray($REShowerForceSubIDs)>>
 	<<set $REShowerForceSubIDs = $REShowerForceSubIDs.random()>>
-	<<set $subSlave = $slaves.find(function(s) { return s.ID == $REShowerForceSubIDs; })>>
+	<<set $subSlave = $slaves[$slaveIndices[$REShowerForceSubIDs]]>>
 <</if>>
 
 <<case "repressed anal virgin">>
 
 <<if Array.isArray($RERepressedAnalVirginSubIDs)>>
 	<<set $RERepressedAnalVirginSubIDs = $RERepressedAnalVirginSubIDs.random()>>
-	<<set _s = $slaves.findIndex(function(s) { return s.ID == $RERepressedAnalVirginSubIDs; })>>
-	<<set $subSlave = $slaves[_s]>>
-	<<set $slaves[_s].analCount += 1>>
-	<<set $analTotal += 1>>
+	<<set $subSlave = $slaves[$slaveIndices[$RERepressedAnalVirginSubIDs]]>>
 <</if>>
 
 <<case "top exhaustion">>
 
-<<set $subSlave = $slaves.find(function(s) { return s.ID == $eventSlave.relationshipTarget; })>>
+<<set $subSlave = $slaves[$slaveIndices[$eventSlave.relationshipTarget]]>>
 
 <<case "simple assault">>
 
 <<if Array.isArray($RESimpleAssaultIDs)>>
 	<<set $RESimpleAssaultIDs = $RESimpleAssaultIDs.random()>>
-	<<set $subSlave = $slaves.find(function(s) { return s.ID == $RESimpleAssaultIDs; })>>
+	<<set $subSlave = $slaves[$slaveIndices[$RESimpleAssaultIDs]]>>
 <</if>>
 
 <<case "cockmilk interception">>
@@ -131,7 +128,7 @@
 	<<set $RECockmilkInterceptionIDs = $RECockmilkInterceptionIDs.shuffle()>>
 	<<for _i = 0; _i < $RECockmilkInterceptionIDs.length; _i++>>
 		<<if $eventSlave.ID != $RECockmilkInterceptionIDs[_i]>>
-			<<set $subSlave = $slaves.find(function(s) { return s.ID == $RECockmilkInterceptionIDs[_i]; })>>
+			<<set $subSlave = $slaves[$slaveIndices[$RECockmilkInterceptionIDs[_i]]]>>
 			<<break>>
 		<</if>>
 	<</for>>
@@ -143,7 +140,7 @@
 	<<set $REInterslaveBeggingIDs = $REInterslaveBeggingIDs.shuffle()>>
 	<<for _i = 0; _i < $REInterslaveBeggingIDs.length; _i++>>
 		<<if $eventSlave.ID != $REInterslaveBeggingIDs[_i]>>
-			<<set $subSlave = $slaves.find(function(s) { return s.ID == $REInterslaveBeggingIDs[_i]; })>>
+			<<set $subSlave = $slaves[$slaveIndices[$REInterslaveBeggingIDs[_i]]]>>
 			<<break>>
 		<</if>>
 	<</for>>
@@ -152,7 +149,7 @@
 <<case "incestuous nursing">>
 
 <<if $familyTesting == 0>>
-	<<set $subSlave = $slaves.find(function(s) { return s.ID == $activeSlave.relationTarget; })>>
+	<<set $subSlave = $slaves[$slaveIndices[$activeSlave.relationTarget]]>>
 <<else>>
 	<<set $subSlave = randomAvailableDaughter($activeSlave)>>
 	<<if ndef $subSlave>>
@@ -631,11 +628,11 @@ Both slaves notice you at the same time. $subSlave.slaveName's <<if canSee($subS
 $subSlave.slaveName has been a very good girl this week, so when her <<if $subSlave.anus > 2>>loose asshole<<elseif $subSlave.anus > 1>>big butthole<<else>>tight anus<</if>> catches your eye near the start of a long inspection, you decide to be kind to her as you conduct the rest of your inspection with <<if $PC.dick == 1>>your cock<<else>>a strap-on<</if>>. <<EventNameLink $activeSlave>> is next on the inspection schedule, and when she comes into your office, it's to the <<if canSee($activeSlave)>>sight of $subSlave.slaveName's back and rear<<else>>sound of $subSlave.slaveName<</if>> as she lazily rides her <<WrittenMaster $subSlave>>. You've been sitting on the couch, making out with the compliant girl as she rides you, for a good half hour. Poor $subSlave.slaveName was pent up when you started, and she's climaxed already; she's feeling very devoted and relaxed at the moment, and is doing her best to get you off, too. When you finally come, she moans her thanks into your mouth nonverbally, breaks your lip lock, gives you a peck on the nose, and climbs off you. As she does, she lifts her ass off your <<if $PC.dick == 1>>cock<<else>>strap-on<</if>>, her <<if $subSlave.anus > 2>>gaping anus dripping <<if $PC.dick == 1>>cum<<else>>lube<</if>> all over her $subSlave.skin legs<<elseif $subSlave.anus > 1>>well-fucked backdoor taking a few seconds to recover from its gape, dripping a little <<if $PC.dick == 1>>cum<<else>>lube<</if>> down her $subSlave.skin legs<<else>>still-tight backdoor sliding quickly off you, visibly slick with <<if $PC.dick == 1>>cum<<else>>lube<</if>><</if>>. You didn't fuck her too hard, but <<if $PC.dick == 1>>you're not small<<else>>your strap-ons are not small<</if>>, and she walks a little gingerly as she heads for the bathroom. $activeSlave.slaveName, standing there nude for inspection, stares openmouthed at $subSlave.slaveName as she goes. She's obviously unfamiliar with anal sex.
 <br><br>
 $activeSlave.slaveName coughs and looks doubtful, like she's mulling over a question. You let the poor repressed girl chew on it for a while, and eventually she bursts out, "<<Master $activeSlave>>, what were you doing with $subSlave.slaveName?" The absurdity gives you a moment's pause, but you answer gamely that you were fucking her ass. $activeSlave.slaveName blushes furiously but plunges on, "I'm <<s>>-<<s>>orry, <<Master>>, but I <<s>>till don't under<<s>>tand. I thought <<s>>e<<x>> happened in a v-vagina. I d-didn't think b-butt<<s>> were - were for, you know, that."
-<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-<<set $slaves[_rets].analCount++, $analTotal++>>
-<<if $PC.dick == 1 && canGetPregnant($slaves[_rets]) && $slaves[_rets].eggType == "human">>
-	<<KnockMeUp $slaves[_rets] 5 1 -1 1>>
+<<set $subSlave.analCount++, $analTotal++>>
+<<if $PC.dick == 1 && canGetPregnant($subSlave) && $subSlave.eggType == "human">>
+	<<KnockMeUp $subSlave 5 1 -1 1>>
 <</if>>
+<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 
 <<case "top exhaustion">>
 
@@ -1007,8 +1004,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<set $rep += 100>>
 	<<set $subSlave.oralCount++, $activeSlave.oralCount++>>
 	<<set $oralTotal += 2>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <br><<link "Get involved in the taste testing">>
@@ -1021,8 +1017,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	"Whaa-" the slave starts to ask warily before $activeSlave.slaveName pushes her to her knees, spinning her around as she does so. This brings $subSlave.slaveName face to face with your <<if $PC.dick == 1>>stiff prick, a bead of precum already present at its tip<<else>>wet cunt, a bead of pussyjuice already trailing down your inner thigh<</if>>. "Oh, um, hi <<Master $subSlave>>," she stammers, and then starts to <<if $PC.dick == 1>>suck your dick<<if $PC.vagina == 1>> and <</if>><</if>><<if $PC.vagina == 1>>eat your pussy<</if>>. This leaves poor $activeSlave.slaveName without anyone to make out with, so you step in there, grabbing her and pulling the giggling slave in to kiss her deeply. Her mouth is indeed a bit <<if $activeSlave.preg > 20>>sour<<else>>tart<</if>>. She moans into your mouth as she feels her nipples press against <<if $PC.boobs == 1>>yours<<else>>your hard chest<</if>>, and then again as your tongue invades her. When you <<if $PC.dick == 1>>fill $subSlave.slaveName's mouth with cum<<else>>climax wetly against $subSlave.slaveName's mouth<</if>>, you pull away slightly, letting the slave on her knees below you gasp "You ta<<s>>te great, <<Master>>!" before you spin her around in turn so she can give $activeSlave.slaveName her own allotment of oral sex. You leave them to it. They @@.mediumaquamarine;trust you a bit more@@ after such a lighthearted little escapade.
 	<<set $activeSlave.trust += 2, $subSlave.trust += 2, $subSlave.oralCount += 2>>
 	<<set $oralTotal += 2>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <br><<link "Look, a bare butt">>
@@ -1072,8 +1067,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 			<<KnockMeUp $subSlave 5 1 -1 1>>
 		<</if>>
 	<</if>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 
@@ -1086,8 +1080,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<set $cash -= 500>>
 	<<set $subSlave.devotion += 2>>
 	<<set $activeSlave.devotion += 2>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>> //This will cost <<print cashFormat(500)>>//
 <<if $Attendant != 0>>
@@ -1102,8 +1095,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<set $cash -= 500>>
 	<<set $subSlave.devotion += 3>>
 	<<set $activeSlave.devotion += 3>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>> //This will cost <<print cashFormat(500)>>//
 <</if>>
@@ -1118,8 +1110,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<set $cash -= 1000>>
 	<<set $rep += 100>>
 	<<set $subSlave.trust += 2, $activeSlave.trust += 2>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>> //This will cost <<print cashFormat(1000)>>//
 
@@ -1164,8 +1155,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<if canImpreg($subSlave, $activeSlave)>>
 		<<KnockMeUp $subSlave 5 1 $activeSlave.ID 1>>
 	<</if>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <br><<link "Dominate the slave on top">>
@@ -1204,8 +1194,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<set $activeSlave.devotion += 2, $activeSlave.trust += 2, $activeSlave.penetrativeCount++>>
 	<<set $subSlave.analCount++>>
 	<<set $analTotal++, $penetrativeTotal++>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 
@@ -1268,8 +1257,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<</if>>
 	Then you move back up, using them until you're spent and they're lying limply in a pool of sweat and tits.
 	<<set $subSlave.trust += 2, $activeSlave.trust += 2>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <<if $activeSlave.anus > 0 && $seed == 1>>
@@ -1337,8 +1325,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 		"Plea<<s>>e nooo, @@.lime;my poor hole will never be the <<s>>ame againnn.@@"
 		<<set $activeSlave.anus += 1>>
 	<</if>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <</if>>
@@ -1363,8 +1350,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<set $subSlave.devotion += 2, $activeSlave.devotion += 2>>
 	<<set $subSlave.relationship = 3, $subSlave.relationshipTarget = $activeSlave.ID>>
 	<<set $activeSlave.relationship = 3, $activeSlave.relationshipTarget = $subSlave.ID>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <</if>>
@@ -1387,12 +1373,12 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<if canPenetrate($activeSlave)>>
 		<<set $activeSlave.penetrativeCount += 4, $penetrativeTotal += 4>>
 	<</if>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets].analCount += 4, $slaves[_rets].fetish = "buttslut", $slaves[_rets].fetishKnown = 1, $slaves[_rets].fetishStrength = 65>>
+	<<set $subSlave.analCount += 4, $subSlave.fetish = "buttslut", $subSlave.fetishKnown = 1, $subSlave.fetishStrength = 65>>
 	<<set $analTotal += 4>>
-	<<if canPenetrate($activeSlave) && canImpreg($slaves[_rets], $activeSlave)>>
-		<<KnockMeUp $slaves[_rets] 20 1 $activeSlave.ID 1>>
+	<<if canPenetrate($activeSlave) && canImpreg($subSlave, $activeSlave)>>
+		<<KnockMeUp $subSlave 20 1 $activeSlave.ID 1>>
 	<</if>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <br><<link "She's being too gentle">>
@@ -1447,12 +1433,12 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<if canPenetrate($activeSlave)>>
 		<<set $activeSlave.penetrativeCount++, $penetrativeTotal++>>
 	<</if>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets].analCount++, $slaves[_rets].oralCount++, $slaves[_rets].trust -= 4, $slaves[_rets].devotion += 4>>
+	<<set $subSlave.analCount++, $subSlave.oralCount++, $subSlave.trust -= 4, $subSlave.devotion += 4>>
 	<<set $analTotal++, $oralTotal++>>
-	<<if canPenetrate($activeSlave) && canImpreg($slaves[_rets], $activeSlave)>>
-		<<KnockMeUp $slaves[_rets] 20 1 $activeSlave.ID 1>>
+	<<if canPenetrate($activeSlave) && canImpreg($subSlave, $activeSlave)>>
+		<<KnockMeUp $subSlave 20 1 $activeSlave.ID 1>>
 	<</if>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 
@@ -1465,12 +1451,12 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	$subSlave.slaveName desperately takes in a huge breath. $activeSlave.slaveName, who has gotten the idea (and to go by her furious masturbation, clearly likes it), gasps out, "But it'<<s>> going to be <<s>>o big! It'<<s>> going to burn!" Here you begin to apply inexorable pressure. $subSlave.slaveName manages one more deep breath, but it becomes a squeal of anguish and she tries frantically to burrow into the couch, away from the penetrating <<if $PC.dick == 1>>cock<<else>>strap-on<</if>>. "You're going to panic, and <<s>>truggle, and <<if $PC.title != 0>>he<<else>><<sh>>e<</if>>'<<s>> going to hold you down and rape your butt while you <<s>>cream and cry..."
 	$activeSlave.slaveName trails off as she shakes with orgasm; she doesn't say any more, but the @@.hotpink;wild satisfaction@@ <<if canSee($activeSlave)>>in her $activeSlave.eyeColor eyes<<else>>on her face<</if>> says it for her. $subSlave.slaveName, meanwhile, is a mess, but hurries @@.gold;fearfully@@ to obey your instructions to go clean herself, and hides her @@.mediumorchid;hatred@@ as she gingerly applies an enema to her @@.lime;loosened butt.@@
 	<<set $activeSlave.devotion += 5>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets].trust -= 10, $slaves[_rets].devotion -= 5, $slaves[_rets].analCount++, $slaves[_rets].anus = 1>>
+	<<set $subSlave.trust -= 10, $subSlave.devotion -= 5, $subSlave.analCount++, $subSlave.anus = 1>>
 	<<set $analTotal++>>
-	<<if $PC.dick == 1 && canGetPregnant($slaves[_rets]) && $slaves[_rets].eggType == "human">>
-		<<KnockMeUp $slaves[_rets] 5 1 -1 1>>
+	<<if $PC.dick == 1 && canGetPregnant($subSlave) && $subSlave.eggType == "human">>
+		<<KnockMeUp $subSlave 5 1 -1 1>>
 	<</if>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>> //This option will take anal virginity//
 <br><<link "That sounds like the voice of experience">>
@@ -1484,8 +1470,8 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<if $PC.dick == 1 && canGetPregnant($activeSlave) && $activeSlave.eggType == "human">>
 		<<KnockMeUp $activeSlave 5 1 -1 1>>
 	<</if>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets].trust -= 5, $slaves[_rets].devotion += 5>>
+	<<set $subSlave -= 5, $subSlave.devotion += 5>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 
@@ -1498,12 +1484,12 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<if canPenetrate($activeSlave)>>
 		<<set $activeSlave.penetrativeCount++, $penetrativeTotal++>>
 	<</if>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets].analCount++, $slaves[_rets].trust += 4>>
+	<<set $subSlave.analCount++, $subSlave.trust += 4>>
 	<<set $analTotal++>>
-	<<if canPenetrate($activeSlave) && canImpreg($slaves[_rets], $activeSlave)>>
-		<<KnockMeUp $slaves[_rets] 5 1 $activeSlave.ID 1>>
+	<<if canPenetrate($activeSlave) && canImpreg($subSlave, $activeSlave)>>
+		<<KnockMeUp $subSlave 5 1 $activeSlave.ID 1>>
 	<</if>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <br><<link "Double anal">>
@@ -1514,15 +1500,15 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<if canPenetrate($activeSlave)>>
 		<<set $activeSlave.penetrativeCount++, $penetrativeTotal++>>
 	<</if>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets].analCount += 2, $slaves[_rets].trust -= 5>>
+	<<set $subSlave.analCount += 2, $subSlave.trust -= 5>>
 	<<set $analTotal += 2>>
-	<<if $PC.dick == 1 && canGetPregnant($slaves[_rets]) && $slaves[_rets].eggType == "human">>
-		<<KnockMeUp $slaves[_rets] 5 1 -1 1>>
+	<<if $PC.dick == 1 && canGetPregnant($subSlave) && $subSlave.eggType == "human">>
+		<<KnockMeUp $subSlave 5 1 -1 1>>
 	<</if>>
-	<<if canPenetrate($activeSlave) && canImpreg($slaves[_rets], $activeSlave)>>
-		<<KnockMeUp $slaves[_rets] 5 1 $activeSlave.ID 1>>
+	<<if canPenetrate($activeSlave) && canImpreg($subSlave, $activeSlave)>>
+		<<KnockMeUp $subSlave 5 1 $activeSlave.ID 1>>
 	<</if>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 
@@ -1609,21 +1595,21 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	Pleased, you head off to find more amusement, leaving the sex-stained slaves dozing in each other's arms, @@.hotpink;not thinking for a moment@@ about how profoundly sexual pleasure dominates their lives.
 	<<SimpleVCheck>>
 	<<set $activeSlave.devotion += 4>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<if canPenetrate($slaves[_rets])>>
-		<<if canImpreg($activeSlave, $slaves[_rets])>>
-			<<KnockMeUp $activeSlave 5 1 $slaves[_rets].ID 1>>
+	<<if canPenetrate($subSlave)>>
+		<<if canImpreg($activeSlave, $subSlave)>>
+			<<KnockMeUp $activeSlave 5 1 $subSlave.ID 1>>
 		<</if>>
 		<<if $PC.dick == 1 && canGetPregnant($activeSlave) && $activeSlave.eggType == "human">>
 			<<KnockMeUp $activeSlave 5 1 -1 1>>
 		<</if>>
 	<<else>>
-		<<if $PC.dick == 1 && canGetPregnant($slaves[_rets]) && $slaves[_rets].eggType == "human">>
-			<<KnockMeUp $slaves[_rets] 5 1 -1 1>>
+		<<if $PC.dick == 1 && canGetPregnant($subSlave) && $subSlave.eggType == "human">>
+			<<KnockMeUp $subSlave 5 1 -1 1>>
 		<</if>>
 	<</if>>
-	<<set $slaves[_rets].analCount++, $slaves[_rets].penetrativeCount++, $slaves[_rets].devotion += 4>>
+	<<set $subSlave.analCount++, $subSlave.penetrativeCount++, $subSlave.devotion += 4>>
 	<<set $analTotal++, $penetrativeTotal++>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <br><<link "Rinse off with them">>
@@ -1669,9 +1655,9 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	As $activeSlave.slaveName orgasms in your arms, you feel $subSlave.slaveName hug your thighs lightly before starting to <<if $PC.dick == 1>>blow you<<else>>lick your pussy<</if>> herself. Afterward, you bring the tired pair back to their bed and get them tucked in. They @@.mediumaquamarine;find the gesture comforting,@@ and are asleep in an instant.
 	<<SimpleVCheck>>
 	<<set $activeSlave.trust += 4>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets].oralCount++, $slaves[_rets].penetrativeCount++, $slaves[_rets].trust += 4>>
+	<<set $subSlave.oralCount++, $subSlave.penetrativeCount++, $subSlave.trust += 4>>
 	<<set $oralTotal++, $penetrativeTotal++>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 
@@ -1696,19 +1682,19 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 			<<KnockMeUp $activeSlave 5 1 -1 1>>
 		<</if>>
 	<</if>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets].trust -= 4>>
+	<<set $subSlave.trust -= 4>>
 	<<if _vaginal>>
-		<<set $slaves[_rets].vaginalCount++, $vaginalTotal++>>
-		<<if canPenetrate($activeSlave) && canImpreg($slaves[_rets], $activeSlave)>>
-			<<KnockMeUp $slaves[_rets] 5 0 $activeSlave.ID 1>>
+		<<set $subSlave.vaginalCount++, $vaginalTotal++>>
+		<<if canPenetrate($activeSlave) && canImpreg($subSlave, $activeSlave)>>
+			<<KnockMeUp $subSlave 5 0 $activeSlave.ID 1>>
 		<</if>>
 	<<else>>
-		<<set $slaves[_rets].analCount++, $analTotal++>>
-		<<if canPenetrate($activeSlave) && canImpreg($slaves[_rets], $activeSlave)>>
-			<<KnockMeUp $slaves[_rets] 5 1 $activeSlave.ID 1>>
+		<<set $subSlave.analCount++, $analTotal++>>
+		<<if canPenetrate($activeSlave) && canImpreg($subSlave, $activeSlave)>>
+			<<KnockMeUp $subSlave 5 1 $activeSlave.ID 1>>
 		<</if>>
 	<</if>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <br><<link "Slide in alongside">>
@@ -1732,26 +1718,26 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<if $subSlave.vagina != 0 && _vaginal == 0>>$subSlave.slaveName has another hole, and she tearfully begs you to use it, but in vain.<</if>>
 	You jam yourself inside, enjoying $subSlave.slaveName's wriggling<<if !_fit>> and the extreme tightness of her overfilled insides. She spasms with pain as you force your way inside her<</if>>. $activeSlave.slaveName can't thrust much from where she is, and serves mostly to tighten $subSlave.slaveName for you, but she <<if canSee($activeSlave)>>stares into your eyes lovingly<<else>>lovingly smiles at you<</if>>. Playing such an equal sexual role with you definitely @@.mediumaquamarine;builds her trust@@ in her role. For her part, $subSlave.slaveName is @@.gold;thoroughly degraded,@@ <<if _fit>>but physically unhurt.<<else>>and @@.orange;stretched out.@@<</if>>
 	<<set $activeSlave.trust += 4, $activeSlave.penetrativeCount++, $penetrativeTotal++>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets].trust -= 4>>
+	<<set $subSlave.trust -= 4>>
 	<<if _vaginal>>
-		<<set $slaves[_rets].vaginalCount++, $vaginalTotal++>>
+		<<set $subSlave.vaginalCount++, $vaginalTotal++>>
 		<<if $PC.dick == 1 && canGetPregnant($activeSlave) && $activeSlave.eggType == "human">>
 			<<KnockMeUp $activeSlave 5 0 -1 1>>
 		<</if>>
-		<<if canPenetrate($activeSlave) && canImpreg($slaves[_rets], $activeSlave)>>
-			<<KnockMeUp $slaves[_rets] 5 0 $activeSlave.ID 1>>
+		<<if canPenetrate($activeSlave) && canImpreg($subSlave, $activeSlave)>>
+			<<KnockMeUp $subSlave 5 0 $activeSlave.ID 1>>
 		<</if>>
 	<<else>>
-		<<set $slaves[_rets].analCount++, $analTotal++>>
+		<<set $subSlave.analCount++, $analTotal++>>
 		<<if $PC.dick == 1 && canGetPregnant($activeSlave) && $activeSlave.eggType == "human">>
 			<<KnockMeUp $activeSlave 5 1 -1 1>>
 		<</if>>
-		<<if canPenetrate($activeSlave) && canImpreg($slaves[_rets], $activeSlave)>>
-			<<KnockMeUp $slaves[_rets] 5 1 $activeSlave.ID 1>>
+		<<if canPenetrate($activeSlave) && canImpreg($subSlave, $activeSlave)>>
+			<<KnockMeUp $subSlave 5 1 $activeSlave.ID 1>>
 		<</if>>
 	<</if>>
-	<<if !_fit>><<if _vaginal>><<set $slaves[_rets].vagina++>><<else>><<set $slaves[_rets].anus++>><</if>><</if>>
+	<<if !_fit>><<if _vaginal>><<set $subSlave.vagina++>><<else>><<set $subSlave.anus++>><</if>><</if>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <br><<link "Put a stop to it">>
@@ -1764,9 +1750,9 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<Enunciate $subSlave>>
 	$subSlave.slaveName gets to her feet too, using a hand to massage her outraged hole. "Thank you, <<Master $subSlave>>, thank you," she repeats over and over, @@.mediumaquamarine;weeping with relief.@@
 	<<set $activeSlave.trust -= 4, $activeSlave.penetrativeCount++, $penetrativeTotal++>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets].trust += 4>>
-	<<if _vaginal>><<set $slaves[_rets].vaginalCount++, $vaginalTotal++>><<else>><<set $slaves[_rets].analCount++, $analTotal++>><</if>>
+	<<set $subSlave.trust += 4>>
+	<<if _vaginal>><<set $subSlave.vaginalCount++, $vaginalTotal++>><<else>><<set $subSlave.analCount++, $analTotal++>><</if>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 
@@ -1803,8 +1789,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 		<<set $activeSlave.oralCount++, $oralTotal++>>
 	<</if>>
 	<<set $activeSlave.devotion += 3, $subSlave.devotion += 3>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <<if $subSlave.lactation>>
@@ -1825,8 +1810,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<set $subSlave.oralCount++, $oralTotal++, $subSlave.mammaryCount++, $mammaryTotal++>>
 	<<set $activeSlave.oralCount++, $oralTotal++>>
 	<<set $activeSlave.trust += 5>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <</if>>
@@ -1866,8 +1850,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	Denied the taste of most of your semen, deposited far back and beyond her taste buds, she forms a tight seal around your shaft as she pulls her head back and off your cock, sucking the residual drops out of you and onto her tongue. She swallows, gives a <<if $activeSlave.trust > 20>>contented<<else>>relieved<</if>> sigh, and looks up at you @@.hotpink;devotedly.@@
 	<<set $activeSlave.oralCount++, $oralTotal++>>
 	<<set $activeSlave.devotion += 5>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <</if>>
@@ -1891,18 +1874,18 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 		turns to $subSlave.slaveName, shoving her dick up the <<SlaveTitle $subSlave>>$desc's butt. $subSlave.slaveName gasps, wriggles herself into a more comfortable position, and then flexes her ass a little, letting the <<SlaveTitle $activeSlave>>$desc whose cock is inside her anus know that she can go for it. $activeSlave.slaveName does, thrusting happily.
 	<</if>>
 	<<set $activeSlave.devotion += 5, $activeSlave.penetrativeCount++, $penetrativeTotal++>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
 	<<if _vaginal>>
-		<<set $slaves[_rets].vaginalCount++, $vaginalTotal++>>
-		<<if canPenetrate($activeSlave) && canImpreg($slaves[_rets], $activeSlave)>>
-			<<KnockMeUp $slaves[_rets] 5 0 $activeSlave.ID 1>>
+		<<set $subSlave.vaginalCount++, $vaginalTotal++>>
+		<<if canPenetrate($activeSlave) && canImpreg($subSlave, $activeSlave)>>
+			<<KnockMeUp $subSlave 5 0 $activeSlave.ID 1>>
 		<</if>>
 	<<else>>
-		<<set $slaves[_rets].analCount++, $analTotal++>>
-		<<if canPenetrate($activeSlave) && canImpreg($slaves[_rets], $activeSlave)>>
-			<<KnockMeUp $slaves[_rets] 5 1 $activeSlave.ID 1>>
+		<<set $subSlave.analCount++, $analTotal++>>
+		<<if canPenetrate($activeSlave) && canImpreg($subSlave, $activeSlave)>>
+			<<KnockMeUp $subSlave 5 1 $activeSlave.ID 1>>
 		<</if>>
 	<</if>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <<if $subSlave.energy > 40>>
@@ -1997,8 +1980,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 			<<KnockMeUp $subSlave 5 1 $activeSlave.ID 1>>
 		<</if>>
 	<</if>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <</if>>
@@ -2061,18 +2043,18 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 			<<KnockMeUp $activeSlave 5 1 -1 1>>
 		<</if>>
 	<</if>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
 	<<if _vaginal>>
-		<<set $slaves[_rets].devotion += 3, $slaves[_rets].vaginalCount++, $vaginalTotal++>>
-		<<if $PC.dick == 1 && canGetPregnant($slaves[_rets]) && $slaves[_rets].eggType == "human">>
-			<<KnockMeUp $slaves[_rets] 5 0 -1 1>>
+		<<set $subSlave.devotion += 3, $subSlave.vaginalCount++, $vaginalTotal++>>
+		<<if $PC.dick == 1 && canGetPregnant($subSlave) && $subSlave.eggType == "human">>
+			<<KnockMeUp $subSlave 5 0 -1 1>>
 		<</if>>
 	<<else>>
-		<<set $slaves[_rets].devotion += 3, $slaves[_rets].analCount++, $analTotal++>>
-		<<if $PC.dick == 1 && canGetPregnant($slaves[_rets]) && $slaves[_rets].eggType == "human">>
-			<<KnockMeUp $slaves[_rets] 5 1 -1 1>>
+		<<set $subSlave.devotion += 3, $subSlave.analCount++, $analTotal++>>
+		<<if $PC.dick == 1 && canGetPregnant($subSlave) && $subSlave.eggType == "human">>
+			<<KnockMeUp $subSlave 5 1 -1 1>>
 		<</if>>
 	<</if>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <br><<link "Rescind the rule against rape">>
@@ -2091,18 +2073,18 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<</if>>
 	"Thank<<s>>, <<Master>>," pants $activeSlave.slaveName as she humps away. "I'm @@.mediumaquamarine;looking forward@@ to being able to do thi<<s>> whenever I want." $subSlave.slaveName gasps, from <<if _vaginal>>down under $activeSlave.slaveName<<else>>where $activeSlave.slaveName has her face ground against the floor<</if>>. Apparently, she hadn't realized that this wasn't a onetime thing, and is @@.gold;none too pleased@@ by having to give $activeSlave.slaveName her <<if _vaginal>>pussy<<else>>ass<</if>> whenever she wants it.
 	<<set $activeSlave.trust += 3, $activeSlave.penetrativeCount++, $penetrativeTotal++>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
 	<<if _vaginal>>
-		<<set $slaves[_rets].trust -= 3, $slaves[_rets].vaginalCount++, $vaginalTotal++>>
-		<<if canPenetrate($activeSlave) && canImpreg($slaves[_rets], $activeSlave)>>
-			<<KnockMeUp $slaves[_rets] 5 1 $activeSlave.ID 1>>
+		<<set $subSlave.trust -= 3, $subSlave.vaginalCount++, $vaginalTotal++>>
+		<<if canPenetrate($activeSlave) && canImpreg($subSlave, $activeSlave)>>
+			<<KnockMeUp $subSlave 5 1 $activeSlave.ID 1>>
 		<</if>>
 	<<else>>
-		<<set $slaves[_rets].trust -= 3, $slaves[_rets].analCount++, $analTotal++>>
-		<<if canPenetrate($activeSlave) && canImpreg($slaves[_rets], $activeSlave)>>
-			<<KnockMeUp $slaves[_rets] 5 1 $activeSlave.ID 1>>
+		<<set $subSlave.trust -= 3, $subSlave.analCount++, $analTotal++>>
+		<<if canPenetrate($activeSlave) && canImpreg($subSlave, $activeSlave)>>
+			<<KnockMeUp $subSlave 5 1 $activeSlave.ID 1>>
 		<</if>>
 	<</if>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>> // This option WILL rescind the universal rule against interslave rape. //
 
@@ -2128,8 +2110,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<set $subSlave.trust += 3, $subSlave.oralCount++, $oralTotal++, $subSlave.mammaryCount++, $mammaryTotal++>>
 	<<EventFetish $activeSlave "boobs">>
 	<<EventFetish $subSlave "boobs">>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <<if $activeSlave.relationship <= 3 && $activeSlave.relationship >= 0>>
@@ -2233,8 +2214,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 	<<set $activeSlave.devotion += 5, $subSlave.devotion += 5>>
 	<<set $activeSlave.relationship = 4, $subSlave.relationship = 4>>
 	<<set $activeSlave.relationshipTarget = $subSlave.ID, $subSlave.relationshipTarget = $activeSlave.ID>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 <</if>>
@@ -2273,8 +2253,7 @@ she adds impishly. Hearing this, $subSlave.slaveName lets the breast pop free of
 		You ask her if she knows what she's just done, rhetorically, and then helpfully explain that it's a little weird to nurse at age $subSlave.actualAge, and bit perverted to play with her mother's _hands. $subSlave.slaveName hangs her head, and then makes to bury it in her weeping mother's heaving breasts to hide her face in shame, but stops when she realizes what she's doing. She's @@.gold;scared,@@ unable to find anything she can do to make this better, and @@.hotpink;takes refuge@@ in your merciful orders to go clean herself up.
 		<<set $subSlave.trust -= 3, $subSlave.devotion += 3>>
 	<</if>>
-	<<set _rets = $slaves.findIndex(function(s) { return s.ID == $subSlave.ID; })>>
-	<<set $slaves[_rets] = $subSlave>>
+	<<set $slaves[$slaveIndices[$subSlave.ID]] = $subSlave>>
 	<</replace>>
 <</link>>
 
diff --git a/src/uncategorized/pUndergroundRailroad.tw b/src/uncategorized/pUndergroundRailroad.tw
index 31ce2d491b9aaebebf868fe4368b2f6d1ebbba64..75a83342985a74971603ce5167d061264b3e6a94 100644
--- a/src/uncategorized/pUndergroundRailroad.tw
+++ b/src/uncategorized/pUndergroundRailroad.tw
@@ -93,11 +93,8 @@ that several nondescript citizens she sees occasionally at work have passed a fe
 	<<replace "#result">>
 	You calmly inform her that she's free to go. She almost collapses with shock, but turns and hurries out of the arcology, tears streaming from her eyes. She wanders down through the arcology, attracting little notice. One moment the monitors have her struggling through a dense-packed crowd, and the next, they don't.
 	<<if $activeSlave.relationship > 0>>
-		<<for $i = 0; $i < $slaves.length; $i++>>
-			<<if $activeSlave.relationshipTarget == $slaves[$i].ID>>
-				<<set $activeSlave.relationshipTarget = 0, $activeSlave.relationship = 0, $slaves[$i].relationshipTarget = 0, $slaves[$i].relationship = 0>>
-			<</if>>
-		<</for>>
+		<<set $i = $slaveIndices[$activeSlave.relationshipTarget]>>
+		<<set $activeSlave.relationshipTarget = 0, $activeSlave.relationship = 0, $slaves[$i].relationshipTarget = 0, $slaves[$i].relationship = 0>>
 	<</if>>
 	<<set $traitor = $activeSlave>>
 	<<set $traitorStats = {PCpregSource: 0, PCmother: 0, PCfather: 0, traitorMother: [], traitorFather: [], traitorPregSources: [], traitorMotherTank: [], traitorFatherTank: []}>>
@@ -152,9 +149,7 @@ that several nondescript citizens she sees occasionally at work have passed a fe
 	<<replace "#result">>
 	$activeSlave.slaveName almost @@.mediumorchid;faints with relief@@ when it becomes apparent you aren't going to punish her for speaking of freedom. All attempts to use your monitoring systems to find the citizens who contacted her fail; it seems their ability to corrupt your systems is considerable. @@.mediumorchid;Whispers of freedom@@ run like wildfire amongst your slaves.
 	<<set $activeSlave.devotion -= 15>>
-	<<for $i = 0; $i < $slaves.length; $i++>>
-		<<set $slaves[$i].devotion -= 10>>
-	<</for>>
+	<<run $slaves.forEach(function(s) { s.devotion -= 10; })>>
 	<</replace>>
 <</link>>
 <br><<link "Publicly flog her for treasonous conversation">>
diff --git a/src/uncategorized/reAnalPunishment.tw b/src/uncategorized/reAnalPunishment.tw
index f1c0baf19bfced6a2c96020ece8bab588b95d242..6459b5fcc8689b9703fe41a1c10ce97a5918ebab 100644
--- a/src/uncategorized/reAnalPunishment.tw
+++ b/src/uncategorized/reAnalPunishment.tw
@@ -31,14 +31,9 @@ $HeadGirl.slaveName is very much acting within her duties, and $activeSlave.slav
 	You ignore $activeSlave.slaveName - no small feat, since the poor <<if $activeSlave.physicalAge > 30>>woman<<else>>girl<</if>> is clinging to your leg - and tell $HeadGirl.slaveName to carry on. Your Head Girl @@.mediumaquamarine;puffs up a bit with pride,@@ and orders the weeping slave to present her anus. The <<if $activeSlave.physicalAge > 30>>woman<<else>>girl<</if>> does not resist, but neither does she comply. $HeadGirl.slaveName jabs a thumb into $activeSlave.slaveName's side, right above her kidney, driving the wind out of the slave with a pained grunt. She arches her back involuntarily and her grip on you loosens, and $HeadGirl.slaveName drags her off you. She jabs her again, depriving her victim of breath completely, and then takes her by the ankle, dragging the slave across the floor with comic effect. The slave leaves a trail of tears across the flooring as she vanishes into the room. As you continue making your rounds, you hear a drawn-out howl followed by rhythmic screaming.
 	<<set $activeSlave.analCount += 1>>
 	<<set $analTotal += 1>>
-	<<for $i = 0; $i < $slaves.length; $i++>>
-		<<if $slaves[$i].ID == $HeadGirl.ID>>
-		<<set $slaves[$i].trust += 4>>
-		<<set $slaves[$i].penetrativeCount += 1>>
-		<<set $penetrativeTotal += 1>>
-		<<break>>
-		<</if>>
-	<</for>>
+	<<set $HeadGirl.trust += 4, $HeadGirl.penetrativeCount += 1>>
+	<<set $penetrativeTotal += 1>>
+	<<set $slaves[$slaveIndices[$HeadGirl.ID]] = $HeadGirl>>
 	<</nobr>>
 	<</replace>>
 <</link>>
@@ -65,17 +60,11 @@ $HeadGirl.slaveName is very much acting within her duties, and $activeSlave.slav
 		PLEASE DON'T THRUST
 	<</if>>
 	 - AAAH! AAAH! AAAH!"
-	<<set $activeSlave.trust -= 5>>
-	<<set $activeSlave.analCount += 1>>
+	<<set $activeSlave.trust -= 5, $activeSlave.analCount += 1>>
 	<<set $analTotal += 1>>
-	<<for $i = 0; $i < $slaves.length; $i++>>
-		<<if $slaves[$i].ID == $HeadGirl.ID>>
-		<<set $slaves[$i].devotion += 4>>
-		<<set $slaves[$i].penetrativeCount += 1>>
-		<<set $penetrativeTotal += 1>>
-		<<break>>
-		<</if>>
-	<</for>>
+	<<set $HeadGirl.devotion += 4, $HeadGirl.penetrativeCount += 1>>
+	<<set $penetrativeTotal += 1>>
+	<<set $slaves[$slaveIndices[$HeadGirl.ID]] = $HeadGirl>>
 	<</nobr>>
 	<</replace>>
 <</link>>
@@ -87,12 +76,7 @@ $HeadGirl.slaveName is very much acting within her duties, and $activeSlave.slav
 	<<nobr>>
 	You tell $HeadGirl.slaveName you've decided to be merciful, just this once. $activeSlave.slaveName holds your leg even harder, @@.mediumaquamarine;sobbing her thanks@@ over and over until you reach down, pat her head, and tell her it will be all right, calming the hysterical <<if $activeSlave.physicalAge > 30>>woman<<else>>girl<</if>>. $HeadGirl.slaveName, meanwhile, stammers an apology. She hurries about her business, @@.gold;badly puzzled@@ and more than a little shaken. She thought she had the authority to anally rape misbehaving slaves, but she's no longer so sure of her rights and responsibilities.
 	<<set $activeSlave.trust += 4>>
-	<<for $i = 0; $i < $slaves.length; $i++>>
-		<<if $slaves[$i].ID == $HeadGirl.ID>>
-		<<set $slaves[$i].trust -= 15>>
-		<<break>>
-		<</if>>
-	<</for>>
+	<<set $slaves[$slaveIndices[$HeadGirl.ID]].trust -= 15>>
 	<</nobr>>
 	<</replace>>
 <</link>>
diff --git a/src/uncategorized/reBoomerang.tw b/src/uncategorized/reBoomerang.tw
index f82678ec56de0716e9cfa12dff298db1ddf2d0eb..86372efe1f4cce658a9619223cc0fc6b0fadf044 100644
--- a/src/uncategorized/reBoomerang.tw
+++ b/src/uncategorized/reBoomerang.tw
@@ -382,8 +382,8 @@ It isn't obvious how she managed to escape, though no doubt you could review the
 		<</if>>
 	<<else>>
 		<<if $boomerangStats.boomerangRelation > 0>>
-			<<set _reb = $slaves.findIndex(function(s) { return s.ID == $boomerangStats.boomerangRelation; })>>
-			<<if _reb != -1>>
+			<<set _reb = $slaveIndices[$boomerangStats.boomerangRelation]>>
+			<<if def _reb>>
 				<<if $activeSlave.relation == "mother">>
 					<<set $slaves[_reb].relation = "daughter">>
 				<<elseif $activeSlave.relation == "daughter">>
@@ -405,16 +405,16 @@ It isn't obvious how she managed to escape, though no doubt you could review the
 		<</if>>
 	<</if>>
 	<<if $boomerangStats.boomerangRelationship > 0>>
-		<<set _reb = $slaves.findIndex(function(s) { return s.ID == $boomerangStats.boomerangRelationship; })>>
-		<<if _reb != -1>>
+		<<set _reb = $slaveIndices[$boomerangStats.boomerangRelationship]>>
+		<<if def _reb>>
 			<<set $slaves[_reb].relationship = $activeSlave.relationship, $slaves[_reb].relationshipTarget = $activeSlave.ID>>
 		<<else>>
 			<<set $activeSlave.relationship = 0, $activeSlave.relationshipTarget = 0>>
 		<</if>>
 	<</if>>
 	<<if $boomerangStats.boomerangRivalry > 0>>
-		<<set _reb = $slaves.findIndex(function(s) { return s.ID == $boomerangStats.boomerangRivalry; })>>
-		<<if _reb != -1>>
+		<<set _reb = $slaveIndices[$boomerangStats.boomerangRivalry]>>
+		<<if def _reb>>
 			<<set $slaves[_reb].rivalry = $activeSlave.rivalry, $slaves[_reb].rivalryTarget = $activeSlave.ID>>
 		<<else>>
 			<<set $activeSlave.rivalry = 0, $activeSlave.rivalryTarget = 0>>
diff --git a/src/uncategorized/reDevotedMotherDaughter.tw b/src/uncategorized/reDevotedMotherDaughter.tw
index 296dad9ce9a2cd1a60253bab51fb91f18ee9911b..bc4f93d4e0ac026e31cd84202eea18341be34cc5 100644
--- a/src/uncategorized/reDevotedMotherDaughter.tw
+++ b/src/uncategorized/reDevotedMotherDaughter.tw
@@ -2,8 +2,8 @@
 
 <<set $nextButton = "Continue", $nextLink = "RIE Eligibility Check">>
 
-<<set $i = $slaves.findIndex(function(s) { return s.ID == $devMother.ID; })>>
-<<set $j = $slaves.findIndex(function(s) { return s.ID == $devDaughter.ID; })>>
+<<set $i = $slaveIndices[$devMother.ID]>>
+<<set $j = $slaveIndices[$devDaughter.ID]>>
 
 $devMother.slaveName and her daughter $devDaughter.slaveName are both good slaves, devoted and obedient. They'd probably do anything you order them to do. By happenstance they come before you for inspection one after the other. They certainly see each other stark naked frequently enough. As you finish $devMother.slaveName's inspection, her daughter waits patiently for her turn. It occurs to you that they probably would do //anything// you order them to do, and that they're so acclimated to sexual slavery that they might well enjoy it.
 
diff --git a/src/uncategorized/reDevotedTwins.tw b/src/uncategorized/reDevotedTwins.tw
index 30a0ff421d27434afaaec79cbd9f9cdd0b259785..74d179dfb94afdc9421bc3caf30c6a4141d8bd71 100644
--- a/src/uncategorized/reDevotedTwins.tw
+++ b/src/uncategorized/reDevotedTwins.tw
@@ -2,8 +2,8 @@
 
 <<set $nextButton = "Continue", $nextLink = "RIE Eligibility Check">>
 
-<<set $i = $slaves.findIndex(function(s) { return s.ID == $alphaTwin.ID; })>>
-<<set $j = $slaves.findIndex(function(s) { return s.ID == $betaTwin.ID; })>>
+<<set $i = $slaveIndices[$alphaTwin.ID]>>
+<<set $j = $slaveIndices[$betaTwin.ID]>>
 
 $alphaTwin.slaveName and $betaTwin.slaveName are such good and devoted slaves that they happily do everything together. They sleep in each other's arms, bathe together, work together whenever they can, and fuck together. For a while they masturbated together until they became so habituated to sexual slavery that they stopped seeing much distinction between masturbation and sex with one another. At the moment, they're getting ready for their day, chatting quietly and helping each other.
 <br><br>
diff --git a/src/uncategorized/reDevotees.tw b/src/uncategorized/reDevotees.tw
index 36b6c8f62087c46796d5520223d7eaaaa03e92c8..245b78fcf280cb2a981549d96e9a8140c724528d 100644
--- a/src/uncategorized/reDevotees.tw
+++ b/src/uncategorized/reDevotees.tw
@@ -2,10 +2,10 @@
 
 <<set $nextButton = "Continue">>
 <<set $nextLink = "RIE Eligibility Check">>
-<<set _i = $slaves.findIndex(function(s) { return s.ID == $devotedSlaves[0].ID; })>>
-<<set _j = $slaves.findIndex(function(s) { return s.ID == $devotedSlaves[1].ID; })>>
-<<set _k = $slaves.findIndex(function(s) { return s.ID == $devotedSlaves[2].ID; })>>
-<<set _l = $slaves.findIndex(function(s) { return s.ID == $devotedSlaves[3].ID; })>>
+<<set _i = $slaveIndices[$devotedSlaves[0].ID]>>
+<<set _j = $slaveIndices[$devotedSlaves[1].ID]>>
+<<set _k = $slaveIndices[$devotedSlaves[2].ID]>>
+<<set _l = $slaveIndices[$devotedSlaves[3].ID]>>
 
 /* 000-250-006 */
 <<if $seeImages == 1>>
diff --git a/src/uncategorized/reFormerAbolitionist.tw b/src/uncategorized/reFormerAbolitionist.tw
index 91f0de068d71907b752584d10072f9912a068f65..d69e8482c64d361524006a9f4a0a7dfdb407e881 100644
--- a/src/uncategorized/reFormerAbolitionist.tw
+++ b/src/uncategorized/reFormerAbolitionist.tw
@@ -7,11 +7,7 @@
 <<set $returnTo = "RIE Eligibility Check">>
 
 <<if $legendaryFacility == 1>>
-	<<for $i = 0; $i < $slaves.length; $i++>>
-	<<if $legendaryAbolitionistID == $slaves[$i].ID>>
-		<<set $activeSlave = $slaves[$i]>>
-	<</if>>
-	<</for>>
+	<<set $activeSlave = $slaves[$slaveIndices[$legendaryAbolitionistID]]>>
 <<else>>
 	<<set $activeSlave = $eventSlave>>
 <</if>>
diff --git a/src/uncategorized/reFullBed.tw b/src/uncategorized/reFullBed.tw
index 6a40e248f469a90e749d201847dd2d8eb022063e..3ace05808ffedef51604bef22f9661f1b1d45f0e 100644
--- a/src/uncategorized/reFullBed.tw
+++ b/src/uncategorized/reFullBed.tw
@@ -2,8 +2,8 @@
 
 <<set $nextButton = "Continue", $nextLink = "RIE Eligibility Check">>
 
-<<set _bedSlaveOne = $slaves.findIndex(function(s) { return s.ID == $bedSlaves[0].ID; })>>
-<<set _bedSlaveTwo = $slaves.findIndex(function(s) { return s.ID == $bedSlaves[1].ID; })>>
+<<set _bedSlaveOne = $slaveIndices[$bedSlaves[0].ID]>>
+<<set _bedSlaveTwo = $slaveIndices[$bedSlaves[1].ID]>>
 
 /* 000-250-006 */
 <<if $seeImages == 1>>
diff --git a/src/uncategorized/reHGReplacement.tw b/src/uncategorized/reHGReplacement.tw
index 9eb7156b2ae13d390e85640bded24cb527c8834c..e7fb749f71e3ab31fee1550400e170208b477a41 100644
--- a/src/uncategorized/reHGReplacement.tw
+++ b/src/uncategorized/reHGReplacement.tw
@@ -27,12 +27,9 @@ When $HeadGirl.slaveName leaves, she clears her throat nervously. She gathers he
 	<<replace "#result">>
 	<<nobr>>
 	After giving the matter some consideration, you agree, instructing $assistantName that $activeSlave.slaveName is now the Head Girl. $activeSlave.slaveName is @@.hotpink;overjoyed,@@ and bounces to her feet, clearly very eager to begin. You caution her that she is not to undermine $HeadGirl.slaveName by letting anyone know why you decided to change Head Girls. She nods obediently. As far as $HeadGirl.slaveName knows, it's just a standard change of Head Girls, and she's too good a slave to let it affect her seriously.
-	<<for $i = 0; $i < $slaves.length; $i++>>
-		<<if $slaves[$i].ID == $HeadGirl.ID>>
-		<<set $slaves[$i].assignment = "rest">>
-		<<set $activeSlave.assignmentVisible = 1>>
-		<</if>>
-	<</for>>
+	<<set $i = $slaveIndices[$HeadGirl.ID]>>
+	<<set $slaves[$i].assignment = "rest">>
+	<<set $slaves[$i].assignmentVisible = 1>>
 	<<set $activeSlave.devotion += 5>>
 	<<set $activeSlave.assignment = "be your Head Girl">>
 	<<set $activeSlave.assignmentVisible = 1>>
@@ -63,15 +60,10 @@ When $HeadGirl.slaveName leaves, she clears her throat nervously. She gathers he
 	$HeadGirl.slaveName hops off the couch, gets down in front of her victim, and shoves her legs apart. $activeSlave.slaveName scrunches up her face, expecting something agonizing to happen to her <<if $activeSlave.dick == 0>>pussy, but $HeadGirl.slaveName shocks her by starting to hungrily eat her out.<<else>>cock, but $HeadGirl.slaveName shocks her by giving her a lush blowjob.<</if>> $activeSlave.slaveName clearly expects a trap, but $HeadGirl.slaveName's attentions slowly distract her. When she's on the very verge of orgasm, your Head Girl suddenly stops and <<if $activeSlave.dick == 0>>pinches the girl's pussylips,<<else>>tugs the girl's cock downward by its head,<</if>> not painfully, but hard enough to communicate threat. $activeSlave.slaveName, shocked out of her pleasure, looks down at her. $HeadGirl.slaveName <<say>>s menacingly, "Bitch, if you orga<<s>>m, I'm going to fucking de<<s>>troy you." Then she goes back to giving $activeSlave.slaveName oral. $activeSlave.slaveName begins to cry, realizing how comprehensively fucked she is.
 	<br><br>
 	Eventually, she climaxes. $HeadGirl.slaveName has a talented tongue. $HeadGirl.slaveName does not begrudge the slave her pleasure, <<if $activeSlave.dick == 0>>tonguing her clit all the way through her orgasm.<<else>>industriously sucking her cock until she's swallowed every last drop of cum.<</if>> She stands up and seizes $activeSlave.slaveName by the ear, <<say>>ing, "And now, <<s>>lut, you are fucked." $activeSlave.slaveName's weeping stopped during her climax, but now she starts to @@.gold;sob with terror,@@ and she cries harder as your Head Girl hauls her out of your office by her ear. $HeadGirl.slaveName @@.mediumaquamarine;waves cheerfully@@ to you as she leaves with her victim.
-	<<for $i = 0; $i < $slaves.length; $i++>>
-		<<if $slaves[$i].ID == $HeadGirl.ID>>
-		<<set $slaves[$i].trust += 4>>
-		<<set $slaves[$i].oralCount += 1>>
-		<<set $oralTotal += 1>>
-		<</if>>
-	<</for>>
-	<<set $activeSlave.trust -= 4>>
-	<<set $activeSlave.oralCount += 1>>
+	<<set $i = $slaveIndices[$HeadGirl.ID]>>
+	<<set $slaves[$i].trust += 4, $slaves[$i].oralCount += 1>>
+	<<set $oralTotal += 1>>
+	<<set $activeSlave.trust -= 4, $activeSlave.oralCount += 1>>
 	<<set $oralTotal += 1>>
 	<</nobr>>
 	<</replace>>
diff --git a/src/uncategorized/saRelationships.tw b/src/uncategorized/saRelationships.tw
index 136126ebd11a9aed9574ce0391b770bba2f3b17f..13a2ab87611526fbfee07a18b21049b73e6ec07a 100644
--- a/src/uncategorized/saRelationships.tw
+++ b/src/uncategorized/saRelationships.tw
@@ -1,7 +1,7 @@
 :: SA relationships [nobr]
 
 <<if $slaves[$i].fuckdoll == 0>>
-	<<set _SL = $slaves.length, _SlaveI = $slaves[$i], _SlaveJ = null, _J = -1, _K = -1, _drop = 0>>
+	<<set _SL = $slaves.length, _SlaveI = $slaves[$i], _SlaveJ = null, _drop = 0>>
 	<<if _SlaveI.relationship == 0 && _SlaveI.fetish != "mindbroken">>
 		<<if (_SlaveI.devotion + _SlaveI.trust > 175) && (random(1,3) == 1)>>
 			_SlaveI.slaveName is quite devoted to you, and trusts both you and her place as a slave. Since she does not have a strong relationship with another slave,
@@ -42,12 +42,10 @@
 				<<if _SlaveJ.fetish != "mindbroken" && _SlaveJ.prestigeDesc == "You bankrupted and enslaved her in revenge for her part in the attack on your arcology by the Daughters of Liberty.">>
 					_SlaveI.slaveName greets _SlaveJ.slaveName with joy, happy to see her former owner again. Without any regard to you, they continue their prior relationship.
 					<<if _SlaveJ.relationship > 0>>
-					<<for _k = 0; _k < _SL; _k++>>
-						<<if _SlaveJ.relationshipTarget == $slaves[_k].ID>>
+						<<set _k = $slaveIndices[_SlaveJ.relationshipTarget]>>
+						<<if def _k>>
 							<<set $slaves[_k].relationshipTarget = 0, $slaves[_k].relationship = 0>>
-							<<break>>
 						<</if>>
-					<</for>>
 					<</if>>
 					<<set _SlaveJ.relationship = 4, _SlaveJ.relationshipTarget = _SlaveI.ID, _SlaveI.relationship = 4, _SlaveI.relationshipTarget = _SlaveJ.ID>>
 					<<break>>
@@ -200,16 +198,13 @@
 		<<set _drop = 1>>
 	<</if>>
 	<<if (_SlaveI.relationship > 0) || (_SlaveI.relation > 0)>>
-		<<for _j = 0; _j < _SL; _j++>>
-			<<if _SlaveI.relationshipTarget == $slaves[_j].ID>>
-				<<set _SlaveJ = $slaves[_j], _J = _j , _SlaveJ.relationshipTarget = _SlaveI.ID, _SlaveJ.relationship = _SlaveI.relationship>>
-			<</if>>
-			<<if _SlaveI.relationTarget == $slaves[_j].ID>>
-				<<if _SlaveI.rivalryTarget != _SlaveI.relationTarget>>
-					<<set _K = _j>>
-				<</if>>
-			<</if>>
-		<</for>>
+		<<set _J = $slaveIndices[_SlaveI.relationshipTarget]>>
+		<<if def _J>>
+			<<set _SlaveJ = $slaves[_J], _SlaveJ.relationshipTarget = _SlaveI.ID, _SlaveJ.relationship = _SlaveI.relationship>>
+		<</if>>
+		<<if _SlaveI.rivalryTarget != _SlaveI.relationTarget>>
+			<<set _K = $slaveIndices[_SlaveI.relationTarget]>>
+		<</if>>
 		<<if (_SlaveI.relationship > 0) && (_SlaveJ == null)>>
 			<br>@@.red;_SlaveI.slaveName's relationship was _SlaveI.relationship and relationshipTarget was _SlaveI.relationshipTarget but no slave with that ID was found@@<br>
 			<<set _SlaveI.relationship = 0, _SlaveI.relationshipTarget = 0>>
@@ -1161,7 +1156,7 @@
 			<<if totalRelatives(_SlaveI) > 0>>
 				<<set $relation = 0>>
 				<<set $relationType = 0>>
-				<<set _sr = $slaves.find(function(s) { return s.ID == _SlaveI.relationshipTarget; })>>
+				<<set _sr = getSlave(_SlaveI.relationshipTarget)>>
 				<<if def _sr>>
 					<<if (_SlaveI.mother == _sr.ID || _SlaveI.father == _sr.ID || _sr.mother == _SlaveI.ID || _sr.father == _SlaveI.ID || areSisters(_SlaveI, _sr) > 0)>>
 						<<if _sr.mother == _SlaveI.ID || _sr.father == _SlaveI.ID>>
@@ -1559,7 +1554,7 @@
 
 	<<else>>
 
-	<<if _K != -1 && _SlaveI.trust <= 95>>
+	<<if def _K && _SlaveI.trust <= 95>>
 		_SlaveI.slaveName
 		<<if _SlaveI.trust < -20>>
 			<<if _SlaveI.relation == "mother">>