diff --git a/devTools/Script to convert SC to JS/SC to JS 1.py b/devTools/Script to convert SC to JS/SC to JS 1.py
index ddece0976db593759b9d43e04e843f87ebe6511e..fc49bcf15ab000638f8a677f1d1200eb4820a429 100644
--- a/devTools/Script to convert SC to JS/SC to JS 1.py	
+++ b/devTools/Script to convert SC to JS/SC to JS 1.py	
@@ -9,14 +9,14 @@ editor.rereplace(r"\$slaves\[\$i\]", r"slave")
 # Update all references
 editor.rereplace(r"\$", r"V\.")
 
-# Clean up print
-editor.rereplace(r"<<print (.*)>>", r"${\1}")
-editor.rereplace(r"<<= (.*?)>>", r"${\1}")
-
 # Line breaks for embedded code, beautify later
 editor.rereplace(r"([a-zA-Z@].*?)<<", r"$1\n<<")
 editor.rereplace(r">>([a-zA-Z,\.@ ].*?)", r">>\n\t$1")
 
+# Clean up print
+editor.rereplace(r"<<print (.*)>>", r"V.\1")
+editor.rereplace(r"<<= (.*?)>>", r"V\.\1")
+
 # Raw text
 editor.rereplace(r"	([a-zA-Z@\.,`'; ].*)", r"	r.push\(`\1`\);")
 
@@ -25,6 +25,7 @@ editor.rereplace(r"<<if (.*?)>>", r"if \1 {")
 editor.rereplace(r"<<elseif (.*?)>>", r"} else if \(\1\) {")
 editor.rereplace(r"<<else>>", r"} else {")
 editor.rereplace(r"<</if>>", r"}")
+
 #fix paren
 editor.rereplace(r"([	\n])if ([^\(].*) {", r"\1if \(\2\) {")
 editor.rereplace(r"([	\n])else if ([^\(].*) {", r"\1 else if \(\2\) {")
@@ -32,12 +33,10 @@ editor.rereplace(r"([	\n])else if ([^\(].*) {", r"\1 else if \(\2\) {")
 # run can happen directly
 editor.rereplace(r"<<run (.*?)>>", r"\1;")
 
-# Set: If it uses "=" let's assume we should let and clean up later
-editor.rereplace(r"<<set (.*? =.*?)>>", r"let $1;")
-editor.rereplace(r"let (slave\.)", r"$1")
-editor.rereplace(r"let (V\.)", r"$1")
+# Clean up unset
+editor.rereplace(r"<<unset (.*)>>", r"delete \1;")
 
-# Set: otherwise we are likely modifying the value
+# Set
 editor.rereplace(r"<<set (.*?)>>", r"$1;")
 
 #Switch
@@ -50,10 +49,14 @@ editor.rereplace(r"<<default>>", r"default:")
 editor.rereplace(r"@@\.(.*?);(.*?)@@", r"<span class=\"\1\">\2</span>")
 editor.rereplace(r"@@\.(.*?);", r"<span class=\"\1\">")
 editor.rereplace(r"@@", r"</span>")
+#remove incompatible comment style
+editor.rereplace(r"/%", r"/*")
+editor.rereplace(r"%/", r"*/")
 
 # JS
 editor.rereplace(r" == ", r" === ")
 editor.rereplace(r" != ", r" !== ")
+editor.rereplace(r"_S\.", r"S.")
 
 #fix pronouns
 editor.rereplace(r"V\.Hers", r"\${Hers}")
@@ -94,9 +97,12 @@ editor.rereplace(r"_Hers2", r"\${_Hers2}")
 editor.rereplace(r"_hers2", r"\${_hers2}")
 
 #look for variables embedded in literals
-editor.rereplace(r"(	r.push.*?[^{])(V\.[^ ,']*)", r"\1${\2}")
-editor.rereplace(r"(	r.push.*?[^{])(slave\.[^ ,']*)", r"\1${\2}")
-
-#remove incompatible comment style
-editor.rereplace(r"/%", r"/*")
-editor.rereplace(r"%/", r"*/")
\ No newline at end of file
+editor.rereplace(r"(	r.push[^;]*?)(V\.[^ ,<'`]*)", r"\1${\2}")
+editor.rereplace(r"(	r.push[^;]*?)(slave\.[^ ,<'`]*)", r"\1${\2}")
+editor.rereplace(r"(	r.push[^;]*?)(S\.[^ ,<'`]*)", r"\1${\2}")
+editor.rereplace(r"(	r.push[^;]*?)( _[^ ,<'`]*)", r"\1${ \2}")
+
+#Cleanup
+editor.rereplace(r"\${He}adGirl", r"V.HeadGirl")
+editor.rereplace(r"\${slave}", r"slave")
+editor.rereplace(r"\${slave\.}", r"slave.")
\ No newline at end of file
diff --git a/devTools/concatFiles.bat b/devTools/concatFiles.bat
index 3da9527a846693b3f9a9c87fea44c70c5b48e6f4..0d4cc2e819a5c2f48363983a41d554ffc6bac05c 100644
--- a/devTools/concatFiles.bat
+++ b/devTools/concatFiles.bat
@@ -1,15 +1,29 @@
 @echo off
 :: Concatenates files from dir %1 specified with wildcard %2 and outputs result to %3
 
+:: temporary codepage change to avoid mojibake
+FOR /f "tokens=2 delims=:." %%x IN ('CHCP') DO SET _CP=%%x
+CHCP 65001 > NUL
+
 :: TODO Proper temp file instead of bin\list.txt
 IF EXIST %3 DEL %3
 SET _LISTFILE="bin\list.txt"
->%_LISTFILE% (FOR /R "%~1" %%F IN (%2) DO echo "%%F")
-sort /O %_LISTFILE% %_LISTFILE%
-(FOR /F "usebackq delims=" %%F IN (`type "%_LISTFILE%"`) DO (
+
+:: Collect sorted list of files
+ECHO "Ignore the first line to skip the BOM" >%_LISTFILE%
+(FOR /R "%~1" %%F IN (%2) DO echo "%%F") | sort >>%_LISTFILE%
+
+:: If we have powershell available, strip the absolute path information
+:: If not, fail silently (which is fine, but will leak path information into the built file)
+powershell -command "" 2> NUL
+IF %ERRORLEVEL% EQU 0 powershell -command "(get-content -path %_LISTFILE% -raw -encoding utf8) -replace [regex]::escape('%CD%'),'' -replace '\"','' ^| set-content -encoding utf8 -path %_LISTFILE%"
+
+:: Append the files
+(FOR /F "skip=1 usebackq delims=" %%F IN (`type "%_LISTFILE%"`) DO (
 	echo /* %%F */ >> %3
-	copy /b %3+%%F %3 1>NUL
+	copy /b %3+"%CD%%%F" %3 1>NUL
 	)
 )
 
 DEL %_LISTFILE%
+CHCP %_CP% > NUL
\ No newline at end of file
diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js
index 9bf02642129d272dfdab8529fc3ea7e943b9f383..5e7dab077961f8b2dde8571e90ce695b85754f51 100644
--- a/js/003-data/gameVariableData.js
+++ b/js/003-data/gameVariableData.js
@@ -58,6 +58,8 @@ App.Data.defaultGameStateVariables = {
 			}
 		}
 	},
+	/** @type {marketGlobal|null} */
+	market: null,
 	FSNamePref: 0,
 	HGFormality: 1,
 	HGSeverity: 0,
diff --git a/src/002-config/fc-version.js b/src/002-config/fc-version.js
index 81d046ed6ba66e2781c24c09e1d9dc6ce4c2675e..80ff391fac2466b02ed1b2c15898e451547a909f 100644
--- a/src/002-config/fc-version.js
+++ b/src/002-config/fc-version.js
@@ -2,5 +2,5 @@ App.Version = {
 	base: "0.10.7.1", // The vanilla version the mod is based off of, this should never be changed.
 	pmod: "3.7.1",
 	commitHash: null,
-	release: 1093
+	release: 1094
 };
diff --git a/src/Mods/SecExp/buildings/secBarracks.tw b/src/Mods/SecExp/buildings/secBarracks.tw
index 56810bbfc20e5f940bd6414202c8d55b69d2c35f..a561c8ddbf4e315bf790150e32d6371e2a26289f 100644
--- a/src/Mods/SecExp/buildings/secBarracks.tw
+++ b/src/Mods/SecExp/buildings/secBarracks.tw
@@ -207,7 +207,9 @@ Your current maximum number of units is <<print App.SecExp.battle.maxUnits()>> (
 			<<link "Form a new unit" "secBarracks">>
 				<<set $slaveUnits.push(App.SecExp.generateUnit("slaves"))>>
 			<</link>>
-		<</if>>
+		<</if>> |
+		<<includeDOM App.SecExp.bulkUpgradeUnit($slaveUnits)>>
+		
 		<<set _popCap = menialPopCap()>>
 		<<set _menialPrice = menialSlaveCost()>>
 		<<set _bulkMax = _popCap.value-$menials-$fuckdolls-$menialBioreactors>>
@@ -254,8 +256,6 @@ Your current maximum number of units is <<print App.SecExp.battle.maxUnits()>> (
 						<</if>>
 					<</link>>
 				<</if>>
-				<<if $SecExp.settings.showStats == 1>> <<= App.SecExp.getUnit("Slaves", _i).printStats()>> <</if>>
-				<<includeDOM App.SecExp.humanUnitUpgradeList($slaveUnits[_i])>>
 			<<else>>
 				<<if $menials > 0>>
 					|
@@ -273,6 +273,9 @@ Your current maximum number of units is <<print App.SecExp.battle.maxUnits()>> (
 					<</link>>
 				<</if>>
 			<</if>>
+			| <<includeDOM App.SecExp.bulkUpgradeUnit($slaveUnits[_i])>>
+			<<if $SecExp.settings.showStats == 1>> <<= App.SecExp.getUnit("Slaves", _i).printStats()>> <</if>>
+			<<includeDOM App.SecExp.humanUnitUpgradeList($slaveUnits[_i])>>
 			<</capture>>
 		<</for>>
 	</div>
@@ -293,8 +296,10 @@ Your current maximum number of units is <<print App.SecExp.battle.maxUnits()>> (
 		<<if $militiaFreeManpower > 0 && App.SecExp.battle.activeUnits() < App.SecExp.battle.maxUnits()>> <br>
 			<<link "Form a new unit" "secBarracks">>
 				<<set $militiaUnits.push(App.SecExp.generateUnit("militia"))>>
-			<</link>>
+			<</link>> |
 		<</if>>
+		<<includeDOM App.SecExp.bulkUpgradeUnit($militiaUnits)>>
+		
 		<br>
 		<<set _mL = $militiaUnits.length>>
 		<<for _i = 0; _i < _mL; _i++>>
@@ -322,8 +327,6 @@ Your current maximum number of units is <<print App.SecExp.battle.maxUnits()>> (
 						<</if>>
 					<</link>>
 				<</if>>
-				<<if $SecExp.settings.showStats == 1>> <<= App.SecExp.getUnit("Militia", _i).printStats()>> <</if>>
-				<<includeDOM App.SecExp.humanUnitUpgradeList($militiaUnits[_i])>>
 			<<else>>
 				<<if $militiaFreeManpower > 0>>
 					|
@@ -341,6 +344,9 @@ Your current maximum number of units is <<print App.SecExp.battle.maxUnits()>> (
 					<</link>>
 				<</if>>
 			<</if>>
+			| <<includeDOM App.SecExp.bulkUpgradeUnit($militiaUnits[_i])>>
+			<<if $SecExp.settings.showStats == 1>> <<= App.SecExp.getUnit("Militia", _i).printStats()>> <</if>>
+			<<includeDOM App.SecExp.humanUnitUpgradeList($militiaUnits[_i])>>
 			<</capture>>
 		<</for>>
 	</div>
@@ -352,8 +358,10 @@ Your current maximum number of units is <<print App.SecExp.battle.maxUnits()>> (
 		<<if $mercFreeManpower > 0 && App.SecExp.battle.activeUnits() < App.SecExp.battle.maxUnits()>> <br>
 			<<link "Form a new unit" "secBarracks">>
 				<<set $mercUnits.push(App.SecExp.generateUnit("mercs"))>>
-			<</link>>
+			<</link>> |
 		<</if>>
+		<<includeDOM App.SecExp.bulkUpgradeUnit($mercUnits)>>
+
 		<br>
 		<<set _meL = $mercUnits.length>>
 		<<for _i = 0; _i < _meL; _i++>>
@@ -381,8 +389,6 @@ Your current maximum number of units is <<print App.SecExp.battle.maxUnits()>> (
 						<</if>>
 					<</link>>
 				<</if>>
-				<<if $SecExp.settings.showStats == 1>> <<= App.SecExp.getUnit("Mercs", _i).printStats()>> <</if>>
-				<<includeDOM App.SecExp.humanUnitUpgradeList($mercUnits[_i])>>
 			<<else>>
 				<<if $mercFreeManpower > 0>>
 					|
@@ -400,6 +406,9 @@ Your current maximum number of units is <<print App.SecExp.battle.maxUnits()>> (
 					<</link>>
 				<</if>>
 			<</if>>
+			| <<includeDOM App.SecExp.bulkUpgradeUnit($mercUnits[_i])>>
+			<<if $SecExp.settings.showStats == 1>> <<= App.SecExp.getUnit("Mercs", _i).printStats()>> <</if>>
+			<<includeDOM App.SecExp.humanUnitUpgradeList($mercUnits[_i])>>
 			<</capture>>
 		<</for>>
 	</div>
diff --git a/src/Mods/SecExp/buildings/weaponsManufacturing.tw b/src/Mods/SecExp/buildings/weaponsManufacturing.tw
index 0f06a8a51d3762b58a7cc361803d5ef364b5f37b..ec51be61070f9c6fcecae145eb716fecf5051bc8 100644
--- a/src/Mods/SecExp/buildings/weaponsManufacturing.tw
+++ b/src/Mods/SecExp/buildings/weaponsManufacturing.tw
@@ -149,20 +149,24 @@ You own <<print num($menials)>> free menial slaves. This manufacturing complex c
 
 <<set _time = Math.ceil(_baseUpgradeTime / $SecExp.buildings.weapManu.productivity)>>
 <br><br>Upgrades: With our current industrial and research capabilities upgrades will be finished in _time weeks.
-<<if $SecExp.buildings.weapManu.upgrades.current.time <= 0>>
+<<if App.SecExp.weapManuUpgrade.fully().bots && App.SecExp.weapManuUpgrade.fully().human>>
+	<<run delete $SecExp.buildings.weapManu.upgrades.queue>>
+<<else>>
+	<<set $SecExp.buildings.weapManu.upgrades.queue = $SecExp.buildings.weapManu.upgrades.queue || []>>
+
 	<br>Security Drones:
 	<<if $SecExp.buildings.weapManu.lab < 3>>
 		Upgrade the research facility further to unlock more upgrades for the security drones.
 	<</if>>
-	<<if $SecExp.buildings.weapManu.upgrades.completed.includesAll(-1, -2, -3)>>
+	<<if App.SecExp.weapManuUpgrade.fully().bots>>
 		You have fully upgraded the security drones.
 	<<else>>
-		<p> <<includeDOM App.SecExp.weapManuUpgrade.purchase(-1)>> </p>
+		<div> <<includeDOM App.SecExp.weapManuUpgrade.purchase(-1)>> </div>
 		<<if $SecExp.buildings.weapManu.lab >= 2>>
-			<p> <<includeDOM App.SecExp.weapManuUpgrade.purchase(-2)>> </p>
+			<div> <<includeDOM App.SecExp.weapManuUpgrade.purchase(-2)>> </div>
 		<</if>>
 		<<if $SecExp.buildings.weapManu.lab >= 3>>
-			<p> <<includeDOM App.SecExp.weapManuUpgrade.purchase(-3)>> </p>
+			<div> <<includeDOM App.SecExp.weapManuUpgrade.purchase(-3)>> </div>
 		<</if>>
 		<br>
 	<</if>>
@@ -178,42 +182,44 @@ You own <<print num($menials)>> free menial slaves. This manufacturing complex c
 	<<elseif $SecExp.buildings.weapManu.lab < 3>>
 		Upgrade the research facility further to unlock more upgrades for human troops.
 	<</if>>
-	
-	<p> <<includeDOM App.SecExp.weapManuUpgrade.purchase(0)>> </p>
-	<p> <<includeDOM App.SecExp.weapManuUpgrade.purchase(1)>> </p>
+	<div> <<includeDOM App.SecExp.weapManuUpgrade.purchase(0)>> </div>
+	<div> <<includeDOM App.SecExp.weapManuUpgrade.purchase(1)>> </div>
 	<<if $SecExp.buildings.weapManu.lab >= 2>>	
-		<p> <<includeDOM App.SecExp.weapManuUpgrade.purchase(2)>> </p>
-		<p> <<includeDOM App.SecExp.weapManuUpgrade.purchase(3)>> </p>
+		<div> <<includeDOM App.SecExp.weapManuUpgrade.purchase(2)>> </div>
+		<div> <<includeDOM App.SecExp.weapManuUpgrade.purchase(3)>> </div>
 	<</if>>
 	<<if $SecExp.buildings.weapManu.lab >= 3>>
-		<p> <<includeDOM App.SecExp.weapManuUpgrade.purchase(4)>> </p>
-		<p> <<includeDOM App.SecExp.weapManuUpgrade.purchase(5)>> </p>
+		<div> <<includeDOM App.SecExp.weapManuUpgrade.purchase(4)>> </div>
+		<div> <<includeDOM App.SecExp.weapManuUpgrade.purchase(5)>> </div>
 	<</if>>
 	<<if $SF.Toggle && $SF.Active >= 1>>
 		<<if $SecExp.buildings.weapManu.lab >= 2 && $SecExp.edicts.SFSupportLevel >= 2 && $SF.Squad.Firebase >= 7>>
-			<p> <<includeDOM App.SecExp.weapManuUpgrade.purchase(6)>> </p>
+			<div> <<includeDOM App.SecExp.weapManuUpgrade.purchase(6)>> </div>
 		<</if>>
 		<<if $SecExp.buildings.weapManu.lab >= 2 && $SecExp.edicts.SFSupportLevel >= 4 && $SF.Squad.Drugs >= 8>>
-			<p> <<includeDOM App.SecExp.weapManuUpgrade.purchase(7)>> </p>
+			<div> <<includeDOM App.SecExp.weapManuUpgrade.purchase(7)>> </div>
 		<</if>>
 		<<if $SecExp.buildings.weapManu.lab >= 3 && $SecExp.edicts.SFSupportLevel >= 5>>
-			<p> <<includeDOM App.SecExp.weapManuUpgrade.purchase(8)>> </p>
+			<div> <<includeDOM App.SecExp.weapManuUpgrade.purchase(8)>> </div>
 		<</if>>
 	<</if>>
-<<else>>
-	<<set _current = App.SecExp.weapManuUpgrade.current()>>
-	<br>You are developing _current.dec.
-	It is for _current.unit. It will enhance their _current.purpose.
-	Estimated completion time is <<= numberWithPluralOne($SecExp.buildings.weapManu.upgrades.current.time, "week")>>.
-	<br>
+	
+	<<for _i = 0; _i < $SecExp.buildings.weapManu.upgrades.queue.length; _i++>>
+		<<set _current = App.SecExp.weapManuUpgrade.current($SecExp.buildings.weapManu.upgrades.queue[_i].ID)>>
+		<<if _i === 0>><br>Currently developing<<else>><br><<= ordinalSuffix(_i + 1)>> in queue<</if>>:
+		_current.dec for _current.unit. It will enhance their _current.purpose.
+		Estimated completion time is <<= numberWithPluralOne($SecExp.buildings.weapManu.upgrades.queue[_i].time, "week")>>
+	<</for>>
 <</if>>
 
-<<set _completed = $SecExp.buildings.weapManu.upgrades.completed.length>>
-<<if _completed > 0>>
+<<set _completed = $SecExp.buildings.weapManu.upgrades.completed>>
+<<if _completed.length > 0>>
+	<p>
 	You have completed the following projects:
-	<<for _i = 0; _i < _completed; _i++>>
-		<<= App.SecExp.weapManuUpgrade.current($SecExp.buildings.weapManu.upgrades.completed[_i]).dec>><<if _i < _completed - 1>>,<<else>>.<</if>>
+	<<for _i = 0; _i < _completed.length; _i++>>
+		<<= App.SecExp.weapManuUpgrade.current($SecExp.buildings.weapManu.upgrades.completed[_i]).dec>><<if _i < _completed.length - 1>>,<<else>>.<</if>>
 	<</for>>
+	</p>
 <</if>>
-<br><br> <<set _cost = Math.trunc(10000*$upgradeMultiplierArcology)>>
-[[Return this sector to standard manufacturing|Main][delete $SecExp.buildings.weapManu, cashX(-_cost), "capEx"), App.Arcology.cellUpgrade($building, App.Arcology.Cell.Manufacturing, "Weapon Manufacturing", "Manufacturing")]] //Costs <<print cashFormat(_cost)>>//
\ No newline at end of file
+<<set _cost = Math.trunc(10000*$upgradeMultiplierArcology)>>
+<p>[[Return this sector to standard manufacturing|Main][delete $SecExp.buildings.weapManu, cashX(-_cost), "capEx"), App.Arcology.cellUpgrade($building, App.Arcology.Cell.Manufacturing, "Weapon Manufacturing", "Manufacturing")]] //Costs <<print cashFormat(_cost)>>//</p>
\ No newline at end of file
diff --git a/src/Mods/SecExp/js/Unit.js b/src/Mods/SecExp/js/Unit.js
index ff6e8ea632909b7c00fedec1433eaa8e89a0d0d3..f03ee4f779b93021f287d94d1b7b6d2bb2cbcdaa 100644
--- a/src/Mods/SecExp/js/Unit.js
+++ b/src/Mods/SecExp/js/Unit.js
@@ -1,3 +1,122 @@
+/** Creates a bulk upgrade link for the unit that is passed.
+ * @param {object} [unit] the unit to be checked.
+ */
+App.SecExp.bulkUpgradeUnit = function(unit) {	
+	// unit.length === 'undefined' ? object : array  
+	const unitCount = typeof unit.length === 'undefined' ? 1 : unit.length;
+	console.log('unitCount', unitCount);
+	let el = document.createElement("a");
+	console.log('cost', getCost());
+	if (getCost() > 0) {
+		el.append(App.UI.DOM.link(`Bulk upgrade for ${cashFormat(getCost())}`, () => {
+			applyUpgrades();
+			cashX(-getCost(), "securityExpansion");
+		},
+		[], passage()
+		));
+	}
+	return el;
+
+	function getCost() {
+		let cost = 0;
+		const equipUpgradeCost = 250;
+		if (unitCount === 1) {
+			if (unit.maxTroops < 50) {
+				cost += 5000 + (((50 - unit.maxTroops) /10) * equipUpgradeCost * (unit.equip + unit.commissars + unit.cyber + unit.SF));
+			}
+			if (unit.equip < 3) {
+				cost += (equipUpgradeCost * unit.maxTroops + 1000) * (3 - unit.equip);
+			}
+			if (unit.commissars < 2) {
+				cost += (equipUpgradeCost * unit.maxTroops + 1000) * (2 - unit.commissars);
+			}
+			if (V.prostheticsUpgrade >= 2 || V.researchLab.advCombatPLimb === 1) {
+				if (unit.cyber === 0) {
+					cost += equipUpgradeCost * unit.maxTroops + 2000;
+				}
+			}
+			if (unit.medics === 0) {
+				cost += equipUpgradeCost * unit.maxTroops + 1000;
+			}
+			if (V.SF.Toggle && V.SF.Active >= 1 && unit.SF === 0) {
+				cost += equipUpgradeCost * unit.maxTroops + 5000;
+			}
+		} else {
+			for (let i = 0; i < unitCount; i++) {
+				if (unit[i].maxTroops < 50) {
+					cost += 5000 + (((50 - unit[i].maxTroops) /10) * equipUpgradeCost * (unit[i].equip + unit[i].commissars + unit[i].cyber + unit[i].SF));
+				}
+				if (unit[i].equip < 3) {
+					cost += (equipUpgradeCost * unit[i].maxTroops + 1000) * (3 - unit[i].equip);
+				}
+				if (unit[i].commissars < 2) {
+					cost += (equipUpgradeCost * unit[i].maxTroops + 1000) * (2 - unit[i].commissars);
+				}
+				if (V.prostheticsUpgrade >= 2 || V.researchLab.advCombatPLimb === 1) {
+					if (unit[i].cyber === 0) {
+						cost += equipUpgradeCost * unit[i].maxTroops + 2000;
+					}
+				}
+				if (unit[i].medics === 0) {
+					cost += equipUpgradeCost * unit[i].maxTroops + 1000;
+				}
+				if (V.SF.Toggle && V.SF.Active >= 1 && unit[i].SF === 0) {
+					cost += equipUpgradeCost * unit[i].maxTroops + 5000;
+				}
+			}
+		}
+		return Math.ceil(cost *= 1.1);
+	}
+
+	function applyUpgrades() {
+		if (unitCount === 1) {
+			if (unit.maxTroops < 50) {
+				unit.maxTroops = 50;
+			}
+			if (unit.equip < 3) {
+				unit.equip = 3;
+			}
+			if (unit.commissars < 2) {
+				unit.commissars = 2;
+			}
+			if (V.prostheticsUpgrade >= 2 || V.researchLab.advCombatPLimb === 1) {
+				if (unit.cyber === 0) {
+					unit.cyber++;
+				}
+			}
+			if (unit.medics === 0) {
+				unit.medics++;
+			}
+			if (V.SF.Toggle && V.SF.Active >= 1 && unit.SF === 0) {
+				unit.SF++;
+			}
+		} else {
+			for (let i = 0; i < unitCount; i++) {
+				if (unit[i].maxTroops < 50) {
+					unit[i].maxTroops = 50;
+				}
+				if (unit[i].equip < 3) {
+					unit[i].equip = 3;
+				}
+				if (unit[i].commissars < 2) {
+					unit[i].commissars = 2;
+				}
+				if (V.prostheticsUpgrade >= 2 || V.researchLab.advCombatPLimb === 1) {
+					if (unit[i].cyber === 0) {
+						unit[i].cyber++;
+					}
+				}
+				if (unit[i].medics === 0) {
+					unit[i].medics++;
+				}
+				if (V.SF.Toggle && V.SF.Active >= 1 && unit[i].SF === 0) {
+					unit[i].SF++;
+				}
+			}	
+		}
+	}
+}
+
 /** Reports changes to the supplied unit's loyalty.
  * @param {object} [input] the unit type to be checked.
  */
@@ -209,7 +328,7 @@ App.SecExp.humanUnitUpgradeList = function(input) {
 		},
 		[], passage()
 		));
-		options.append(` to slowly increase this unit's even loyalty.`);
+		options.append(` to slowly increase this unit's loyalty.`);
 	}
 	if (input.commissars === 1) {
 		options.append(" The unit has a commissar detachment, keeping under control the ambitions of the unit's officers.");
diff --git a/src/Mods/SecExp/js/buildingsJS.js b/src/Mods/SecExp/js/buildingsJS.js
index 62dcca7e1e54f7e11e0c7e7d9ec97a2303ddd8f6..00ad32adf82113f7cb0013009e78cd9626b7024a 100644
--- a/src/Mods/SecExp/js/buildingsJS.js
+++ b/src/Mods/SecExp/js/buildingsJS.js
@@ -3,6 +3,7 @@ App.SecExp.weapManuUpgrade = (function() {
 		baseTime,
 		current,
 		purchase,
+		fully,
 	};
 	
 	/** Weeks to completion without any modification.
@@ -15,7 +16,7 @@ App.SecExp.weapManuUpgrade = (function() {
 	 * @returns {Object}
 	 */
 	function current(x = null) {
-		let o = {unit: "our human troops", ID: jsDef(x) ? x : V.SecExp.buildings.weapManu.upgrades.current.ID};
+		let o = {unit: "our human troops", ID: jsDef(x) ? x : V.SecExp.buildings.weapManu.upgrades.queue[0].ID};
 		switch(o.ID) {
 			case -3:
 				Object.assign(o, {
@@ -115,31 +116,50 @@ App.SecExp.weapManuUpgrade = (function() {
 	 * @returns {Node}
 	 */
 	function purchase(x) {
-		let el = document.createElement("div") , options;
+		let el = document.createElement("div"), found = 0;
 		if (!V.SecExp.buildings.weapManu.upgrades.completed.includes(x)) {
-			options = document.createElement("div");
-			const item = current(x), time = Math.ceil(baseTime() / V.SecExp.buildings.weapManu.productivity);
-			el.append(App.UI.DOM.link(`Develop ${item.dec}`, () => {
-				V.SecExp.buildings.weapManu.upgrades.current = {ID: x, time: time};
-				cashX(-item.cost, "capEx");
-			},
-			[], passage()
-			));
-			options.append(`Will take ${time} weeks`);
-			if (item.cost > 0) {
-				options.append(`, cost ${cashFormat(item.cost)}`);
+			for (let i = 0; i < V.SecExp.buildings.weapManu.upgrades.queue.length; i++) {
+				if (V.SecExp.buildings.weapManu.upgrades.queue[i].ID === x) {
+					found = [i]; break;
+				}
 			}
-			options.append(` and will increase `);
-			if (item.type !== "all") {
-				options.append(`the base ${item.type} value${item.type.contains("and") ? 's' : ''}`);				
+			const item = current(x), time = Math.ceil(baseTime() / V.SecExp.buildings.weapManu.productivity);
+			if (found === 0) {
+				el.append(App.UI.DOM.link(`Develop ${item.dec}.`, () => {
+					V.SecExp.buildings.weapManu.upgrades.queue.push({ID: x, time: time});
+					cashX(-item.cost, "capEx");
+				},
+				[], passage()
+				));
+				el.append(`This will take ${time} weeks`);
+				if (item.cost > 0) {
+					el.append(`, cost ${cashFormat(item.cost)}`);
+				}
+				el.append(` and will increase `);
+				if (item.type !== "all") {
+					el.append(`the base ${item.type} value${item.type.contains("and") ? 's' : ''}`);				
+				} else {
+					el.append('all base stats');
+				}
+				el.append(` of ${item.unit}.`);
 			} else {
-				options.append('all base stats');
+				el.append(App.UI.DOM.link(`Remove ${item.dec} from the queue.`, () => {
+					V.SecExp.buildings.weapManu.upgrades.queue.deleteAt(found);
+				},
+				[], passage()
+				));
 			}
-			options.append(` of ${item.unit}.`);
-			el.append(options);
 		}
 		return el;
 	}
+	
+	function fully() {
+		const human = [0, 1, 2, 3, 4, 5] + (V.SF.Toggle && V.SF.Active >= 1 ? [,6, 7, 8] : []);
+		return {
+			human: V.SecExp.buildings.weapManu.upgrades.completed.includesAll(human),
+			bots: V.SecExp.buildings.weapManu.upgrades.completed.includesAll(-1, -2, -3),
+		};
+	}
 })();
 
 App.SecExp.propHub = (function() {
@@ -385,7 +405,6 @@ App.SecExp.weapManu = (function() {
 			},
 			upgrades: {
 				completed: [],
-				current: {time: 0}
 			}
 		};
 	}
@@ -411,37 +430,48 @@ App.SecExp.weapManu = (function() {
 			}
 
 			V.SecExp.buildings.weapManu.upgrades = V.SecExp.buildings.weapManu.upgrades || {};
-			V.SecExp.buildings.weapManu.upgrades.completed = V.SecExp.buildings.weapManu.upgrades.completed || V.completedUpgrades || [];		
-			V.SecExp.buildings.weapManu.upgrades.current = V.SecExp.buildings.weapManu.upgrades.current || {time: 0};
-			if (jsDef(V.currentUpgrade)) {
-				if (!jsDef(V.currentUpgrade.ID)) {
-					if (V.currentUpgrade.name === "magnetic based ballistic weaponry") {
-						V.currentUpgrade.ID = 0;
-					} else if (V.currentUpgrade.name === "ceramo-metallic alloys") {
-						V.currentUpgrade.ID = 1;
-					} else if (V.currentUpgrade.name === "rapid action stimulants") {
-						V.currentUpgrade.ID = 2;
-					} else if (V.currentUpgrade.name === "fast response neural stimulant") {
-						V.currentUpgrade.ID = 3;
-					} else if (V.currentUpgrade.name === "universal cyber enhancements") {
-						V.currentUpgrade.ID = 4;
-					} else if (V.currentUpgrade.name === "remote neural links") {
-						V.currentUpgrade.ID = 5;
-					} else if (V.currentUpgrade.name === "combined training regimens with the special force") {
-						V.currentUpgrade.ID = 6;
-					} else if (V.currentUpgrade.name === "a variant of the stimulant cocktail that the special force created") {
-						V.currentUpgrade.ID = 7;
-					} else if (V.currentUpgrade.name === "a mesh network based off the custom network of the special force") {
-						V.currentUpgrade.ID = 8;
-					} else if (V.currentUpgrade.name === "dynamic battle aware AI") {
-						V.currentUpgrade.ID = -1;
-					} else if (V.currentUpgrade.name === "adaptive armored frames") {
-						V.currentUpgrade.ID = -2;
-					} else if (V.currentUpgrade.name === "advanced synthetic alloys") {
-						V.currentUpgrade.ID = -3;
+			V.SecExp.buildings.weapManu.upgrades.completed = V.SecExp.buildings.weapManu.upgrades.completed || V.completedUpgrades || [];
+			if (!App.SecExp.weapManuUpgrade.fully().bots && !App.SecExp.weapManuUpgrade.fully().human) {
+				V.SecExp.buildings.weapManu.upgrades.queue = V.SecExp.buildings.weapManu.upgrades.queue || [];
+				if (jsDef(V.currentUpgrade)) {
+					if (!jsDef(V.currentUpgrade.ID)) {
+						if (V.currentUpgrade.name === "magnetic based ballistic weaponry") {
+							V.currentUpgrade.ID = 0;
+						} else if (V.currentUpgrade.name === "ceramo-metallic alloys") {
+							V.currentUpgrade.ID = 1;
+						} else if (V.currentUpgrade.name === "rapid action stimulants") {
+							V.currentUpgrade.ID = 2;
+						} else if (V.currentUpgrade.name === "fast response neural stimulant") {
+							V.currentUpgrade.ID = 3;
+						} else if (V.currentUpgrade.name === "universal cyber enhancements") {
+							V.currentUpgrade.ID = 4;
+						} else if (V.currentUpgrade.name === "remote neural links") {
+							V.currentUpgrade.ID = 5;
+						} else if (V.currentUpgrade.name === "combined training regimens with the special force") {
+							V.currentUpgrade.ID = 6;
+						} else if (V.currentUpgrade.name === "a variant of the stimulant cocktail that the special force created") {
+							V.currentUpgrade.ID = 7;
+						} else if (V.currentUpgrade.name === "a mesh network based off the custom network of the special force") {
+							V.currentUpgrade.ID = 8;
+						} else if (V.currentUpgrade.name === "dynamic battle aware AI") {
+							V.currentUpgrade.ID = -1;
+						} else if (V.currentUpgrade.name === "adaptive armored frames") {
+							V.currentUpgrade.ID = -2;
+						} else if (V.currentUpgrade.name === "advanced synthetic alloys") {
+							V.currentUpgrade.ID = -3;
+						}
 					}
+					V.SecExp.buildings.weapManu.upgrades.queue.push({ID: V.currentUpgrade.ID, time: V.currentUpgrade.time});
 				}
-				V.SecExp.buildings.weapManu.upgrades.current = {ID: V.currentUpgrade.ID, time: V.currentUpgrade.time};
+				
+				if (jsDef(V.SecExp.buildings.weapManu.upgrades.current)) {
+					if (V.SecExp.buildings.weapManu.upgrades.current.time > 0) {
+						V.SecExp.buildings.weapManu.upgrades.queue.push(V.SecExp.buildings.weapManu.upgrades.current);
+					}
+					delete V.SecExp.buildings.weapManu.upgrades.current;
+				}
+			} else {
+				delete V.SecExp.buildings.weapManu.upgrades.queue;
 			}
 		}
 	}
diff --git a/src/Mods/SecExp/js/secExp.js b/src/Mods/SecExp/js/secExp.js
index 823ba44a6101232d754af721a5b85db845e3e847..ff5846282ce42459a415963eadc0348556cc36dd 100644
--- a/src/Mods/SecExp/js/secExp.js
+++ b/src/Mods/SecExp/js/secExp.js
@@ -252,9 +252,7 @@ App.SecExp.upkeep = (function() {
 			value += upgrade * Object.values(V.SecExp.buildings.secHub.upgrades.crime).reduce((a, b) => a + b);
 			value += upgrade * Object.values(V.SecExp.buildings.secHub.upgrades.readiness).reduce((a, b) => a + b);
 			value += upgrade * Object.values(V.SecExp.buildings.secHub.upgrades.intel).reduce((a, b) => a + b);
-			if (V.SecExp.edicts.SFSupportLevel >= 5) {
-				value += 1000;
-			}
+			value += V.SecExp.edicts.SFSupportLevel >= 5 ? 1000 : 0;
 		}
 		if (V.SecExp.buildings.barracks) {
 			value += base + upgrade* Object.values(V.SecExp.buildings.barracks).reduce((a, b) => a + b);
@@ -296,7 +294,7 @@ App.SecExp.battle = (function() {
 	function deployedUnits(input = '') {
 		let bots = 0, militiaC = 0, slavesC = 0, mercsC = 0, init = 0;
 		if (V.slaveRebellion !== 1 && V.citizenRebellion !== 1) { // attack
-			if(V.secBots.isDeployed > 0) {
+			if (V.secBots.isDeployed > 0) {
 				bots++;
 			}
 			if (V.SF.Toggle && V.SF.Active >= 1 && V.SFIntervention) {
@@ -307,13 +305,13 @@ App.SecExp.battle = (function() {
 			slavesC += V.slaveUnits.filter((u) => u.isDeployed === 1).length;
 			mercsC += V.mercUnits.filter((u) => u.isDeployed === 1).length;
 		} else { // rebellion
-			if(V.secBots.active > 0) {
+			if (V.secBots.active > 0) {
 				bots++;
 			}
 			if (V.SF.Toggle && V.SF.Active >= 1) {
 				init++;
 			}
-			if(V.irregulars > 0) {
+			if (V.irregulars > 0) {
 				militiaC++;
 			}
 
@@ -322,15 +320,15 @@ App.SecExp.battle = (function() {
 			mercsC += V.mercUnits.filter((u) => u.active === 1 && !V.rebellingID.includes(u.ID)).length;
 		}
 
-		if(input === '') {
+		if (input === '') {
 			return bots+militiaC+slavesC+mercsC+init;
-		} else if(input === 'bots') {
+		} else if (input === 'bots') {
 			return bots;
-		} else if(input === 'militia') {
+		} else if (input === 'militia') {
 			return militiaC;
-		} else if(input === 'slaves') {
+		} else if (input === 'slaves') {
 			return slavesC;
-		} else if(input === 'mercs') {
+		} else if (input === 'mercs') {
 			return mercsC;
 		}
 	}
@@ -406,35 +404,32 @@ App.SecExp.battle = (function() {
 	 */
 	function deployableUnits() {
 		let init = 2 * App.SecExp.battle.deploySpeed();
-		if(V.secBots.isDeployed > 0) {
+		if (V.secBots.isDeployed > 0) {
 			init--;
 		}
 
 		const Militia = V.militiaUnits.length;
-		for(let i = 0; i < Militia; i++) {
-			if(V.militiaUnits[i].isDeployed > 0) {
+		for (let i = 0; i < Militia; i++) {
+			if (V.militiaUnits[i].isDeployed > 0) {
 				init--;
 			}
 		}
 
 		const Slaves = V.slaveUnits.length;
-		for(let i = 0; i < Slaves; i++) {
-			if(V.slaveUnits[i].isDeployed > 0) {
+		for (let i = 0; i < Slaves; i++) {
+			if (V.slaveUnits[i].isDeployed > 0) {
 				init--;
 			}
 		}
 
 		const Mercs = V.mercUnits.length;
-		for(let i = 0; i < Mercs; i++) {
-			if(V.mercUnits[i].isDeployed > 0) {
+		for (let i = 0; i < Mercs; i++) {
+			if (V.mercUnits[i].isDeployed > 0) {
 				init--;
 			}
 		}
 
-		if(init < 0) {
-			init = 0;
-		}
-		return init;
+		return Math.max(0, init);
 	}
 
 	/** Get total active units
@@ -448,15 +443,14 @@ App.SecExp.battle = (function() {
 	 * @returns {number}
 	 */
 	function maxUnits() {
+		let max = 0;
 		if (V.SecExp.buildings.barracks) {
-			let max = 8 + (V.SecExp.buildings.barracks.size * 2);
+			max = 8 + (V.SecExp.buildings.barracks.size * 2);
 			if(App.SecExp.battle.deploySpeed() === 10) {
 				max += 2;
 			}
-			return max;
-		} else {
-			return 0;
 		}
+		return max;
 	}
 
 	/** Get recon score (scale 0-3)
@@ -484,11 +478,8 @@ App.SecExp.battle = (function() {
 		} else {
 			cost = 30000 + baseBribePerAttacker * V.attackTroops;
 		}
-		if (V.majorBattle > 0) {
-			cost *= 3;
-		}
-		cost = Math.trunc(Math.clamp(cost, 0, 1000000));
-		return cost;
+		cost *= V.majorBattle > 0 ? 3 : 1;
+		return Math.trunc(Math.clamp(cost, 0, 1000000));
 	}
 })();
 
@@ -583,12 +574,8 @@ App.SecExp.Check = (function() {
 			if (V.SecExp.buildings.secHub.upgrades.readiness.earlyWarn === 1) {
 				Req += 10;
 			}
-			if (V.SecExp.edicts.SFSupportLevel >= 1) {
-				Req -= 5 * V.SecExp.edicts.SFSupportLevel;
-			}
-			if (V.SecExp.buildings.secHub.coldstorage >= 1) {
-				Req -= 10 * V.SecExp.buildings.secHub.coldstorage;
-			}
+			Req -= 5 * V.SecExp.edicts.SFSupportLevel;
+			Req -= 10 * V.SecExp.buildings.secHub.coldstorage;
 		}
 		return Req;
 	}
diff --git a/src/Mods/SecExp/rebellionHandler.tw b/src/Mods/SecExp/rebellionHandler.tw
index a30bed87ce91a9516c905a6fb1b42bc3e80ea98d..dff703c5f4e302bf525d3d68a77ef6dbc9f32ede 100644
--- a/src/Mods/SecExp/rebellionHandler.tw
+++ b/src/Mods/SecExp/rebellionHandler.tw
@@ -114,8 +114,8 @@
 <<set _moraleTroopMod = Math.clamp(App.SecExp.battle.troopCount() / 100,1,10)>>
 
 /* morale and baseHp calculation */
-<<set _morale = (App.SecExp.BaseDroneUnit.morale * $secBots.active + App.SecExp.BaseMilitiaUnit.morale * App.SecExp.battle.deployedUnits('militia') + App.SecExp.BaseSlaveUnit.morale * App.SecExp.battle.deployedUnits('slaves') + App.SecExp.BaseMercUnit.morale * App.SecExp.battle.deployedUnits('mercs') + App.SecExp.BaseSpecialForcesUnit.morale * $SF.Active) / ($secBots.active + App.SecExp.battle.deployedUnits('militia') + App.SecExp.battle.deployedUnits('slaves') + App.SecExp.battle.deployedUnits('mercs') + $SF.Active)>>
-<<set _morale = _morale + _morale * $SecExp.buildings ? $SecExp.buildings.barracks.luxury : 0 * 0.05>>	/* barracks bonus */
+<<set _morale += (App.SecExp.BaseDroneUnit.morale * $secBots.active + App.SecExp.BaseMilitiaUnit.morale * App.SecExp.battle.deployedUnits('militia') + App.SecExp.BaseSlaveUnit.morale * App.SecExp.battle.deployedUnits('slaves') + App.SecExp.BaseMercUnit.morale * App.SecExp.battle.deployedUnits('mercs') + App.SecExp.BaseSpecialForcesUnit.morale * $SF.Active) / ($secBots.active + App.SecExp.battle.deployedUnits('militia') + App.SecExp.battle.deployedUnits('slaves') + App.SecExp.battle.deployedUnits('mercs') + $SF.Active)>>
+<<set _morale += _morale * $SecExp.buildings.barracks ? $SecExp.buildings.barracks.luxury * 0.05 : 0>>	/* barracks bonus */
 <<set _morale *= _moraleTroopMod>>
 <<set _baseHp = (App.SecExp.BaseDroneUnit.hp * $secBots.active + App.SecExp.BaseMilitiaUnit.hp * App.SecExp.battle.deployedUnits('militia') + App.SecExp.BaseSlaveUnit.hp * App.SecExp.battle.deployedUnits('slaves') + App.SecExp.BaseMercUnit.hp * App.SecExp.battle.deployedUnits('mercs') + App.SecExp.BaseSpecialForcesUnit.hp * $SF.Active) / ($secBots.active + App.SecExp.battle.deployedUnits('militia') + App.SecExp.battle.deployedUnits('slaves') + App.SecExp.battle.deployedUnits('mercs') + $SF.Active)>>
 
diff --git a/src/Mods/SecExp/rebellionReport.tw b/src/Mods/SecExp/rebellionReport.tw
index 77ea87cedc3955b924c29f2c2974f738b587f1bc..e5ccfb4fefbf85a6bc21903882f95cc48ac36d8d 100644
--- a/src/Mods/SecExp/rebellionReport.tw
+++ b/src/Mods/SecExp/rebellionReport.tw
@@ -883,9 +883,6 @@
 	<</if>>
 <</if>>
 
-<br>
-<br>
-
 <<include "unitsRebellionReport">>
 
 /* resets variables and flags */
diff --git a/src/Mods/SecExp/securityReport.tw b/src/Mods/SecExp/securityReport.tw
index aa7c125cd4644e28ba8e57dfce88a3758c7950d3..75f331b8eb89614bc78b7ca83421b4ad8240ec0a 100644
--- a/src/Mods/SecExp/securityReport.tw
+++ b/src/Mods/SecExp/securityReport.tw
@@ -186,16 +186,12 @@
 	<<if $SecExp.edicts.SFSupportLevel >= 1>>
 		Providing your Security Department with equipment from $SF.Lower slightly boosts the security of your arcology.
 	<</if>>
-	<<if $SecExp.edicts.SFSupportLevel >= 1>>
-		<<set _secGrowth *= 1+($SecExp.edicts.SFSupportLevel/10)>>
-	<</if>>
+	<<set _secGrowth *= 1+($SecExp.edicts.SFSupportLevel/10)>>
 <</if>>
 
 /* resting point */
-<<set _secRest = App.SecExp.Check.secRestPoint() * $SecExp.buildings.secHub ? (Math.clamp($SecExp.buildings.secHub.menials,0,App.SecExp.Check.reqMenials()) / App.SecExp.Check.reqMenials()) : 1>>
-<<if _secRest < 0>>
-	<<set _secRest = 20>>
-<</if>>
+<<set _secRest = App.SecExp.Check.secRestPoint() * (Math.clamp($SecExp.buildings.secHub ? $SecExp.buildings.secHub.menials : 0 ,0 , App.SecExp.Check.reqMenials()) / App.SecExp.Check.reqMenials())>>
+<<if _secRest < 0>> <<set _secRest = 20>> <</if>>
 <<if _secRest < App.SecExp.Check.reqMenials() && $SecExp.buildings.secHub>>
 	The limited staff assigned to the HQ hampered the improvements to security achieved this week.
 <<elseif _secRest < App.SecExp.Check.reqMenials()>>
@@ -214,9 +210,7 @@ The security level of the arcology is
 	<<set _secGrowth *= 0.3>>
 <<else>>
 	near its effective resting point, this severely limits the influence of external factors on the change achievable this week.
-	<<if _secGrowth < 0>>
-		<<set _secGrowth *= 0.3>>
-	<</if>>
+	<<if _secGrowth < 0>> <<set _secGrowth *= 0.3>> <</if>>
 <</if>>
 <<set _restGrowth = (_secRest - $SecExp.core.security) * 0.2>>
 <<set _newSec = Math.trunc($SecExp.core.security + _secGrowth + _restGrowth)>>
@@ -318,7 +312,7 @@ Due to the deterioration of the old world countries, organized crime focuses mor
 <</if>>
 
 /* crime cap */
-<<set _crimeCap = Math.trunc(Math.clamp(App.SecExp.Check.crimeCap() + (App.SecExp.Check.crimeCap() - App.SecExp.Check.crimeCap() * $SecExp.buildings.secHub ? ($SecExp.buildings.secHub.menials / App.SecExp.Check.reqMenials()) : 0),0,100))>>
+<<set _crimeCap = Math.trunc(Math.clamp(App.SecExp.Check.crimeCap() + (App.SecExp.Check.crimeCap() - App.SecExp.Check.crimeCap() * ($SecExp.buildings.secHub ? $SecExp.buildings.secHub.menials : 0 / App.SecExp.Check.reqMenials())), 0, 100))>>
 <<if _crimeCap > App.SecExp.Check.crimeCap() && $SecExp.buildings.secHub>>
 	The limited staff assigned to the HQ allows more space for criminals to act.
 <</if>>
@@ -510,21 +504,29 @@ Due to the deterioration of the old world countries, organized crime focuses mor
 	<</if>>
 <</if>>
 
-<<if $SecExp.buildings.weapManu && $SecExp.buildings.weapManu.upgrades.current.time > 0>>
-	<<set _current = App.SecExp.weapManuUpgrade.current(), $SecExp.buildings.weapManu.upgrades.current.time-->>
-	<br>In the research lab, _current.dec
-	<<switch _current.dec>>
-	<<case "adaptive armored frames" "advanced synthetic alloys" "ceramo-metallic alloys" "rapid action stimulants" "universal cyber enhancements" "remote neural links" "combined training regimens with the special force">>
-		are
-	<<default>>
-		is
-	<</switch>>
-	being developed with the aim of enhancing _current.unit' _current.purpose.
-	<<if $SecExp.buildings.weapManu.upgrades.current.time <= 0>>
-		Reports indicate it is ready for deployment and will be issued in the following days.
-		<<set $SecExp.buildings.weapManu.upgrades.completed.push(_current.ID)>>
-		<<set $SecExp.buildings.weapManu.upgrades.current = {time: 0}>>
-	<<else>>
-		It will be finished in <<= numberWithPluralOne($SecExp.buildings.weapManu.upgrades.current.time, "week")>>.
+<<if $SecExp.buildings.weapManu>>
+	<<if App.SecExp.weapManuUpgrade.fully().bots && App.SecExp.weapManuUpgrade.fully().human>> <<run delete $SecExp.buildings.weapManu.upgrades.queue>> <</if>>
+	<<if jsDef($SecExp.buildings.weapManu.upgrades.queue) && $SecExp.buildings.weapManu.upgrades.queue[0].time > 0>>
+		<<set _current = App.SecExp.weapManuUpgrade.current(), $SecExp.buildings.weapManu.upgrades.queue[0].time-->>
+		<br>In the research lab, _current.dec
+		<<switch _current.dec>>
+		<<case "adaptive armored frames" "advanced synthetic alloys" "ceramo-metallic alloys" "rapid action stimulants" "universal cyber enhancements" "remote neural links" "combined training regimens with the special force">>
+			are
+		<<default>>
+			is
+		<</switch>>
+		being developed with the aim of enhancing _current.unit' _current.purpose.
+		<<if $SecExp.buildings.weapManu.upgrades.queue[0].time <= 0>>
+			Reports indicate it is ready for deployment and will be issued in the following days.
+			<<set $SecExp.buildings.weapManu.upgrades.completed.push(_current.ID)>>
+			<<run $SecExp.buildings.weapManu.upgrades.queue.splice(0, 1)>>
+		<<else>>
+			It will be finished in <<= numberWithPluralOne($SecExp.buildings.weapManu.upgrades.queue[0].time, "week")>>.
+		<</if>>
+		<<for _i = 1; _i < $SecExp.buildings.weapManu.upgrades.queue.length; _i++>>
+			<<set _current = App.SecExp.weapManuUpgrade.current($SecExp.buildings.weapManu.upgrades.queue[_i].ID)>>
+			<br><<= ordinalSuffix(_i + 1)>> in queue:
+			_current.dec for _current.unit. It will enhance their _current.purpose.
+		<</for>>
 	<</if>>
 <</if>>
\ No newline at end of file
diff --git a/src/Mods/SecExp/unitsRebellionReport.tw b/src/Mods/SecExp/unitsRebellionReport.tw
index 9ec5cb55eea22044c0f5b220171899fffc842890..56e3694e378eb3785b100ea70ec8b03ff7116d12 100644
--- a/src/Mods/SecExp/unitsRebellionReport.tw
+++ b/src/Mods/SecExp/unitsRebellionReport.tw
@@ -2,17 +2,18 @@
 
 <<if $losses == 0>>
 	<<if $irregulars > 0>>
-		The volunteering citizens were quickly organized into an irregular militia unit and deployed in the arcology. No casualties suffered.
+		<p>The volunteering citizens were quickly organized into an irregular militia unit and deployed in the arcology. No casualties suffered.</p>
 	<</if>>
 	<<if App.SecExp.battle.deployedUnits('bots') >= 1>>
-		<br>Security drones: no casualties suffered.
+		<p>Security drones: no casualties suffered.</p>
 	<</if>>
 	<<if $SF.Toggle && $SF.Active >= 1>>
 		<br>$SF.Lower, <<print num($SF.ArmySize)>> strong, was called to join the battle: no casualties suffered.
 	<</if>>
 	<<set _count = 0>>
 	<<set _loyalUnits = $militiaUnits.length + $slaveUnits.length + $mercUnits.length - $rebellingID.length>>
-	<<if _loyalUnits > 0>> <br>
+	<<if _loyalUnits > 0>>
+		<p>
 		<<for _i = 0; _i < $militiaUnits.length; _i++>>
 			<<if $militiaUnits[_i].active == 1 && (!$rebellingID.includes($militiaUnits[_i].ID))>>
 				<<set $militiaUnits[_i].battlesFought++>>
@@ -47,6 +48,7 @@
 			<</if>>
 		<</for>>
 		participated in the battle without taking any casualties. They remained loyal until the end.
+		</p>
 	<</if>>
 <<elseif $losses > 0>>
 	/* if the losses are more than zero */
@@ -91,7 +93,7 @@
 		<<if _loss > $ACitizens * 0.95>>
 			<<set _loss = Math.trunc($ACitizens * 0.95)>> /* this is unlikely to happen, but might as well be safe*/
 		<</if>>
-		<br><br>The volunteering citizens were quickly organized into an irregular militia unit and deployed in the arcology:
+		<p>The volunteering citizens were quickly organized into an irregular militia unit and deployed in the arcology:
 		<<if _loss <= 0>>
 			no casualties
 		<<elseif _loss <= 10>>
@@ -127,12 +129,13 @@
 		<<else>>
 			<<set $lowerClass -= _loss>>
 		<</if>>
+		</p>
 	<</if>>
 	<<if $secBots.active == 1>>
 		<<set _loss = _lossesList.pluck()>>
 		<<set _loss = Math.clamp(_loss,0,$secBots.troops)>>
 		<<set $secBots.troops -= _loss>>
-		<br><br>Security drones:
+		<p>Security drones:
 		<<if _loss <= 0>>
 			no casualties
 		<<elseif _loss <= 10>>
@@ -151,11 +154,12 @@
 		<<elseif $secBots.troops <= 10>>
 			The unit has very few operatives left, it risks complete annihilation if deployed again.
 		<</if>>
+		</p>
 	<</if>>
 	<<if $SF.Toggle && $SF.Active >= 1>>
 		<<set _loss = _lossesList.pluck()>>
 		<<set _loss = Math.clamp(_loss,0,$SF.ArmySize)>>
-		<br><br> <<= App.SF.Caps()>>, $SF.ArmySize strong, is called to join the battle:
+		<p> <<= App.SF.Caps()>>, $SF.ArmySize strong, is called to join the battle:
 		<<set $SF.ArmySize -= _loss>>
 		<<if _loss <= 0>>
 			no casualties
@@ -169,9 +173,10 @@
 			catastrophic casualties
 		<</if>>
 		suffered.
+		</p>
 	<</if>>
 	<<if App.SecExp.battle.deployedUnits('militia') >= 1>>
-		<br> <<set _med = 0>>
+		<p> <<set _med = 0>>
 		<<for _j = 0; _j < $militiaUnits.length; _j++>>
 			<<if $militiaUnits[_j].active == 1 && !$rebellingID.includes($militiaUnits[_j].ID)>>
 				<<set $militiaUnits[_j].battlesFought++>>
@@ -210,9 +215,10 @@
 				<</if>>
 			<</if>>
 		<</for>>
+		</p>
 	<</if>>
 	<<if App.SecExp.battle.deployedUnits('slaves') >= 1>>
-		<br> <<set _med = 0>>
+		<p> <<set _med = 0>>
 		<<for _j = 0; _j < $slaveUnits.length; _j++>>
 			<<if $slaveUnits[_j].active == 1 && !$rebellingID.includes($slaveUnits[_j].ID)>>
 				<<set $slaveUnits[_j].battlesFought++>>
@@ -255,9 +261,10 @@
 				<</if>>
 			<</if>>
 		<</for>>
+		</p>
 	<</if>>
 	<<if App.SecExp.battle.deployedUnits('mercs') >= 1>>
-		<br> <<set _med = 0>>
+		<p> <<set _med = 0>>
 		<<for _j = 0; _j < $mercUnits.length; _j++>>
 			<<if $mercUnits[_j].active == 1 && !$rebellingID.includes($mercUnits[_j].ID)>>
 				<<set $mercUnits[_j].battlesFought++>>
@@ -296,6 +303,7 @@
 				<</if>>
 			<</if>>
 		<</for>>
+		</p>
 	<</if>>
 <<else>>
 	<br>@@.red;Error: losses are a negative number or NaN@@
@@ -485,4 +493,4 @@
 	<</if>>
 	<<run cashX(forceNeg(1000 * _mercRebelledID.length), "war")>>
 	<<run $mercUnits.deleteWith((u) => _mercRebelledID.includes(u.ID))>>
-<</if>>
+<</if>>
\ No newline at end of file
diff --git a/src/arcologyBuilding/markets.js b/src/arcologyBuilding/markets.js
index 5495f52d0ef8dc2ff9fb9de7f74f3dbfb3bcf9bb..1c1e7bb8c63cb76c6617894fde743fc3a28f99df 100644
--- a/src/arcologyBuilding/markets.js
+++ b/src/arcologyBuilding/markets.js
@@ -55,12 +55,10 @@ App.Arcology.Cell.Market = class extends App.Arcology.Cell.BaseCell {
 					"Corporate Market",
 					"Market",
 					() => {
-						V.market = {
-							market: "corporate",
-							slaveMarket: 0,
-							newSlaves: [],
-							numArcology: 1
-						};
+						V.market = new App.Markets.GlobalVariable();
+						V.market.slaveMarket = "corporate";
+						V.market.newSlaves = [];
+						V.market.numArcology = 1;
 						V.nextButton = "Back to Main";
 						V.nextLink = "Main";
 						V.returnTo = "Main";
diff --git a/src/endWeek/endWeek.js b/src/endWeek/endWeek.js
index 7f1048a943d33641df738be49fe4f420931738e0..13401a676ee9a15ae7b9df9a08e0a1aaacf00e24 100644
--- a/src/endWeek/endWeek.js
+++ b/src/endWeek/endWeek.js
@@ -30,7 +30,7 @@ globalThis.endWeek = (function() {
 
 	function resetSlaveMarkets() {
 		V.gingering = 0;
-		delete V.slaveMarket;
+		V.market = null;
 		for (const school of App.Data.misc.schools) {
 			V[school].schoolSale = 0;
 		}
diff --git a/src/gui/Encyclopedia/encyclopedia.tw b/src/gui/Encyclopedia/encyclopedia.tw
index b91e8eac33ad6dad9bb11cad79c18aafe3429db0..ff329139bc40fd8aa364529acd69ecc404e6e135 100644
--- a/src/gui/Encyclopedia/encyclopedia.tw
+++ b/src/gui/Encyclopedia/encyclopedia.tw
@@ -1242,7 +1242,7 @@ SLAVE FETISHES:
 
 	<br><br>It can be advanced by appropriate smart clit piercing settings, high @@.hotpink;<<= App.Encyclopedia.Dialog.linkSC("devotion", "From Rebellious to Devoted")>>@@ and @@.mediumaquamarine;<<= App.Encyclopedia.Dialog.linkSC("trust", "Trust")>>,@@ being confident, and being cutting.
 
-	<br><br>Dominance will remove the apathetic flaw if a quirk is already present. Doms do not mind a lack of hormonal feminization. The fetish will increase XX attraction. Stewardesses and Nurses do better when <<= App.Encyclopedia.Dialog.linkSC("nymphomaniacs", "Nymphomania")>>. The <<= App.Encyclopedia.Dialog.linkSC("Head Girl", "Head Girl")>>, <<= App.Encyclopedia.Dialog.linkSC("Madam", "Madam")>>, <<= App.Encyclopedia.Dialog.linkSC("Schoolteacher", "Schoolteacher")>>, <<= App.Encyclopedia.Dialog.linkSC("Stewardess", "Stewardess")>>, and <<= App.Encyclopedia.Dialog.linkSC("Nurse", "Nurse")>> can become Doms naturally.
+	<br><br>Dominance will remove the 'apathetic' flaw if a quirk is already present. Doms do not mind a lack of hormonal feminization. The fetish will increase XX attraction. Stewardesses do better when either dominant or <<= App.Encyclopedia.Dialog.linkSC("nymphomaniacal", "Nymphomania")>>. The <<= App.Encyclopedia.Dialog.linkSC("Head Girl", "Head Girl")>>, <<= App.Encyclopedia.Dialog.linkSC("Madam", "Madam")>>, <<= App.Encyclopedia.Dialog.linkSC("Schoolteacher", "Schoolteacher")>>, <<= App.Encyclopedia.Dialog.linkSC("Stewardess", "Stewardess")>>, and <<= App.Encyclopedia.Dialog.linkSC("Nurse", "Nurse")>> can become Doms naturally.
 
 	<br><br>Doms serving as Head Girls may become <<= App.Encyclopedia.Dialog.linkSC("abusive", "Abusiveness")>> if allowed to punish slaves by molesting them.
 
@@ -1262,11 +1262,11 @@ SLAVE FETISHES:
 <<case "Masochists">>
 	''Masochists'' fetishize abuse and pain aimed at themselves.
 
-	<br><br>The fetish can be created by appropriate smart clit piercing settings, serving the Head Girl, relationships, uncomfortable clothing, being <<= App.Encyclopedia.Dialog.linkSC("funny", "Funny")>> and being a<<= App.Encyclopedia.Dialog.linkSC("strugglefuck queen", "Strugglefuck Queen")>>
+	<br><br>The fetish can be created by appropriate smart clit piercing settings, serving the Head Girl, relationships, uncomfortable clothing, being <<= App.Encyclopedia.Dialog.linkSC("funny", "Funny")>> and being a <<= App.Encyclopedia.Dialog.linkSC("strugglefuck queen", "Strugglefuck Queen")>>.
 
-	<br><br>It can be advanced by appropriate smart clit piercing settings, high @@.hotpink;<<= App.Encyclopedia.Dialog.linkSC("devotion", "From Rebellious to Devoted")>>@@ and @@.mediumaquamarine;<<= App.Encyclopedia.Dialog.linkSC("trust", "Trust")>>,@@ being <<= App.Encyclopedia.Dialog.linkSC("funny", "Funny")>> and being a<<= App.Encyclopedia.Dialog.linkSC("strugglefuck queen", "Strugglefuck Queen")>>
+	<br><br>It can be advanced by appropriate smart clit piercing settings, high @@.hotpink;<<= App.Encyclopedia.Dialog.linkSC("devotion", "From Rebellious to Devoted")>>@@ and @@.mediumaquamarine;<<= App.Encyclopedia.Dialog.linkSC("trust", "Trust")>>,@@ being <<= App.Encyclopedia.Dialog.linkSC("funny", "Funny")>> and being a <<= App.Encyclopedia.Dialog.linkSC("strugglefuck queen", "Strugglefuck Queen")>>.
 
-	<br><br>Masochism will soften the liberated flaw into advocate or remove this flaw if a quirk is already present. Masochists can be abused without causing deleterious flaws.
+	<br><br>Masochism will soften the 'liberated' flaw into 'advocate' or remove this flaw if a quirk is already present. Masochists can be abused without causing deleterious flaws.
 
 	<br><br>Masochists serving in an industrialized dairy, in an arcade, or in a glory hole have a chance to become <<= App.Encyclopedia.Dialog.linkSC("self hating", "Self Hatred")>>.
 
diff --git a/src/interaction/main/mainLinks.js b/src/interaction/main/mainLinks.js
index ca0843b8d8c796abb77013a57c0a85a7594721b0..0b1ff62117260bf69d9e1b332ed9988694ff5587 100644
--- a/src/interaction/main/mainLinks.js
+++ b/src/interaction/main/mainLinks.js
@@ -255,12 +255,13 @@ App.UI.View.mainLinks = function() {
 				school,
 				"Market",
 				() => {
-					V.market = {
-						market: abbreviation,
-						slaveMarket: 0,
-						newSlaves: [],
-						numArcology: 1
-					};
+					V.market = new App.Markets.GlobalVariable();
+					V.market.slaveMarket = abbreviation;
+					V.market.newSlaves = [];
+					V.market.numArcology = 1;
+					V.nextButton = "Back to Main";
+					V.nextLink = "Main";
+					V.returnTo = "Main";
 				}),
 			App.UI.DOM.makeElement("span", " will sell at half price this week.", "yellow"));
 		fragment.append(div);
diff --git a/src/markets/market.tw b/src/markets/market.tw
index db77f0628d9170a2d5140148454e553d8b309e98..d3b884f1beda59d07dd10dd381dea9b29fc48b62 100644
--- a/src/markets/market.tw
+++ b/src/markets/market.tw
@@ -1,4 +1,4 @@
 :: Market [nobr jump-to-safe jump-from-safe]
 <span id="slave-markets">
-    <<includeDOM App.Markets[V.market.market]()>>
+    <<includeDOM App.Markets[V.market.slaveMarket]()>>
 </span>
\ No newline at end of file
diff --git a/src/markets/marketUI.js b/src/markets/marketUI.js
index 301a9b3509dbed1d1c6728ce6f29f3bf14b36dcc..0ac1a7fb6ba61f9762ff3c768e3cdf3c5e4bb293 100644
--- a/src/markets/marketUI.js
+++ b/src/markets/marketUI.js
@@ -2,14 +2,13 @@
  *
  * @param {string} slaveMarket
  * @param {object} [param1]
- * @param {number} [param1.numArcology]
  * @param {string} [param1.sTitleSingular]
  * @param {string} [param1.sTitlePlural]
  * @param {number} [param1.costMod]
  */
-App.Markets.purchaseFramework = function(slaveMarket, {numArcology, sTitleSingular = "slave", sTitlePlural = "slaves", costMod = 1} = {}) {
+App.Markets.purchaseFramework = function(slaveMarket, {sTitleSingular = "slave", sTitlePlural = "slaves", costMod = 1} = {}) {
 	const el = new DocumentFragment();
-	const {slave, text} = generateMarketSlave(slaveMarket, (numArcology || 1));
+	const {slave, text} = generateMarketSlave(slaveMarket, (V.market.numArcology || 1));
 	const cost = getCost();
 
 	el.append(text);
@@ -74,7 +73,7 @@ App.Markets.purchaseFramework = function(slaveMarket, {numArcology, sTitleSingul
 					() => {
 						cashX(forceNeg(cost), "slaveTransfer", slave);
 						V.market.newSlaves.push(slave);
-						V.introType = "multi";
+						V.market.introType = "multi";
 						student();
 						jQuery("#slave-markets").empty().append(App.Markets[slaveMarket]);
 					},
@@ -138,3 +137,25 @@ App.Markets.purchaseFramework = function(slaveMarket, {numArcology, sTitleSingul
 		}
 	}
 };
+/**
+ * @typedef {object} marketGlobal
+ * @property {string} slaveMarket
+ * @property {string} introType
+ * @property {Array} newSlaves
+ * @property {number} newSlaveIndex
+ * @property {number} newSlavesDone
+ * @property {number} numSlaves
+ * @property {number} numArcology
+ */
+
+/** @this {marketGlobal} */
+App.Markets.GlobalVariable = function() {
+	this.slaveMarket = "";
+	this.introType = "";
+	this.newSlaves = [];
+	this.newSlaveIndex = 0;
+	this.newSlavesDone = 0;
+	this.numSlaves = 0;
+	this.numArcology = 0;
+	return this;
+};
diff --git a/src/markets/specificMarkets/criminalMarkets.js b/src/markets/specificMarkets/criminalMarkets.js
index 0b27bca57fbee5862228de2a88aeae885688c400..7902a31089be44a156238f08131212a2d7cfd765 100644
--- a/src/markets/specificMarkets/criminalMarkets.js
+++ b/src/markets/specificMarkets/criminalMarkets.js
@@ -19,7 +19,7 @@ App.Markets["gangs and smugglers"] = function() {
 	let r = [];
 	/* males only, or females only if ${V.seeDicks} === 0 */
 	App.UI.DOM.appendNewElement("p", el, `You board the transport to a large gray prison at the edge of the Free City as word of your approach is sent ahead. The visage of the prison itself is a grim one, enclosed by a large gray concrete fence with electrified barbed wire coiled at the top. As the vehicle rolls to a stop before a large gate, the guard in control of the gate operates a board of buttons and levers, promptly opening it so it may continue. "Stay on the road," he respectfully advises, a final remark before letting your driver carry on. Beyond the fence is an array of guard towers manned with drones for 24/7 surveillance, giving you a clear idea of what was to happen if you were not to heed the guard's words and decided to wander off from the group.`);
-	App.UI.DOM.appendNewElement("p", el, `Your destination at the end of the road is a garage, where upon your disembarking, no less than 4 heavily armored guards with electric batons at their sides come to greet you. You could almost mistake them for unmanned drones had they not start speaking. "We've been expecting you; please follow us. We house some dangerous individuals in our establishment and we need to keep you safe." You accept their advice and enter the premises.`);
+	App.UI.DOM.appendNewElement("p", el, `Your destination at the end of the road is a garage, where upon your disembarking, no less than 4 heavily armored guards with electric batons at their sides come to greet you. You could almost mistake them for unmanned drones had they not started speaking. "We've been expecting you; please follow us. We house some dangerous individuals in our establishment and we need to keep you safe." You accept their advice and enter the premises.`);
 
 	r.push(`You are met with a dimly lit concrete hallway as you enter, only for it to open up to a multi-floor prison that had placed its prisoners underground for the most`);
 	if ((V.PC.title === 0 || V.PC.boobs >= 1000 || V.PC.butt >= 3) && V.seeDicks > 0) {
@@ -27,16 +27,16 @@ App.Markets["gangs and smugglers"] = function() {
 	} else {
 		r.push(`part.`);
 	}
-	r.push(`You come to a bridge and look down to see its inhabitants, hard criminals that are coming together for a meal. You watch a fight break out at one point and an armored guard quickly step in and apply his baton to the offenders, coupled with a loud zap that silences the entire area. Around your level, you see the better stock: the attractive prisoners one would show to an interested customer.`);
+	r.push(`You come to a bridge and look down to see its inhabitants, hard criminals that are coming together for a meal. At one point, you watch a fight break out; an armored guard quickly steps in and applies his baton to the offenders, coupled with a loud zap that silences the entire area. Around your level, you see the better stock: the attractive prisoners one would show to an interested customer.`);
 	App.UI.DOM.appendNewElement("p", el, r.join(" "));
 	r = [];
-	r.push(`You finally reach the warden's office, "Welcome`);
+	r.push(`You finally reach the warden's office. "Welcome,`);
 	if (V.PC.title === 1) {
 		r.push(`Mister`);
 	} else {
 		r.push(`Miss`);
 	}
-	r.push(`${V.PC.slaveSurname}, I never thought my prison could have turned to a trade such as this, but times are hard." He beckons you to the seat opposite him, "but I'm not one to complain when an opportunity such as this comes my way." He motions to his guards to bring in a select stock for your perusal. "We house some tough nuts in this establishment, but if you believe you can capitalize on these criminals, we'll be happy to have you take them off our hands." The guard returns with a convict ready to be sold.`);
+	r.push(`${V.PC.slaveSurname}. I never thought my prison could have turned to a trade such as this, but times are hard." He beckons you to the seat opposite him. "But I'm not one to complain when opportunities come my way." He motions to his guards to bring in a select stock for your perusal. "We house some tough nuts in this establishment, but if you believe you can capitalize on these criminals, we'll be happy to have you take them off our hands." The guard returns with a convict ready to be sold.`);
 
 	el.append(r.join(" "));
 	el.append(App.Markets.purchaseFramework("gangs and smugglers", {sTitleSingular: "prisoner", sTitlePlural: "prisoners"}));
@@ -46,7 +46,7 @@ App.Markets["gangs and smugglers"] = function() {
 App.Markets["white collar"] = function() {
 	const el = new DocumentFragment();
 	// mixed prisoners
-	App.UI.DOM.appendNewElement("p", el, `You board the transport to what looks more like an oversized vacation home rather than something one goes to for committing crimes. You enter the premises into a small chamber with a booth to the side and are immediately met with a cheerful "Ah! We've been waiting for you. Please go in. We'll call someone to guide you immediately."`);
+	App.UI.DOM.appendNewElement("p", el, `You board the transport to what looks more like an oversized vacation home rather than something one goes to for committing crimes. You enter the premises into a small chamber with a booth to the side and are immediately met with a cheerful greeting. "Ah! We've been waiting for you. Please go in. We'll call someone to guide you immediately."`);
 	App.UI.DOM.appendNewElement("p", el, `You nod at the prompt and enter further into the luxurious building to find a formally dressed guide and what appears to be the holding area of the prison. The cells, if you can call them that, are large and cozy, each with their own computer and television. The air is also conditioned for their comfort and old world classical music is playing to provide further ambiance. Walking through, you see the prisoners themselves, lazing about in their beds, sitting at their computers, or just talking to each other. If there was ever a prison you'd rather end up in, this would be it.`);
 	App.UI.DOM.appendNewElement("p", el, `You enter the warden's office and are greeted with all due formalities. "Glad to see you at our establishment. When I heard that someone as renowned as yourself was coming over, I made the appropriate preparations." You are served a cup of tea as she brings in the chosen stock for you to observe at your leisure.`);
 
@@ -66,7 +66,7 @@ App.Markets["military prison"] = function() {
 	r.push(`understand the reasoning behind such a design choice.`);
 	App.UI.DOM.appendNewElement("p", el, r.join(" "));
 	App.UI.DOM.appendNewElement("p", el, `Once you arrive at the prison, the door opens to a garage and another door, brightly lit to welcome you to the premises. Through the door, you find the prisoner's quarters, each of them enclosed by electrified fences to ensure your safety as you see the stock. A guard enters, asking you to follow him as he leads you across the chamber to meet with the warden.`);
-	App.UI.DOM.appendNewElement("p", el, `Entering the warden's quarters, you take a seat across from him as he takes the initiative. "Ah, fancy meeting one such as yourself here. Though we house some of the hardiest criminals you can find, I'm sure one such as yourself could find great use for them." He smirks. "... or perhaps great entertainment through the pits," he says as he beckons to his staff as they bring in the selected stock.`);
+	App.UI.DOM.appendNewElement("p", el, `Entering the warden's quarters, you take a seat across from him as he takes the initiative. "Ah, fancy meeting one such as yourself here. Though we house some of the hardiest criminals you can find, I'm sure someone of your capabilities could find great use for them." He smirks. "... or perhaps great entertainment through the pits," he says as he beckons to his staff as they bring in the selected stock.`);
 
 	el.append(r.join(" "));
 	el.append(App.Markets.purchaseFramework("military prison", {sTitleSingular: "prisoner", sTitlePlural: "prisoners"}));
diff --git a/src/markets/specificMarkets/householdLiquidator.js b/src/markets/specificMarkets/householdLiquidator.js
index 83b182635701e6f650e1b9e56191cd45f9399809..b549d5e2aef0b4e3c7bf6dedd6fa0ac338326b68 100644
--- a/src/markets/specificMarkets/householdLiquidator.js
+++ b/src/markets/specificMarkets/householdLiquidator.js
@@ -1,7 +1,7 @@
 App.Markets["Household Liquidator"] = function() {
 	V.encyclopedia = "Household Liquidations";
-	V.introType = "liquidator";
-	V.newSlavesDone = 0;
+	V.market.introType = "liquidator";
+	V.market.newSlavesDone = 0;
 
 	const el = new DocumentFragment();
 	let slave;
@@ -116,8 +116,8 @@ App.Markets["Household Liquidator"] = function() {
 			App.UI.DOM.link(
 				`Buy their slave contract`,
 				() => {
-					V.newSlaves = _newSlaves;
-					V.newSlaves.forEach((s) => cashX(forceNeg(_totalCost / V.newSlaves.length), "slaveTransfer", s));
+					V.market.newSlaves = _newSlaves;
+					V.market.newSlaves.forEach((s) => cashX(forceNeg(_totalCost / V.newSlaves.length), "slaveTransfer", s));
 				},
 				[],
 				"Bulk Slave Intro"
@@ -135,7 +135,7 @@ App.Markets["Household Liquidator"] = function() {
 				V.slavesSeen += 2;
 			},
 			[],
-			"Household Liquidator"
+			"Market"
 		)
 	);
 	App.UI.DOM.appendNewElement("p", el, App.UI.MultipleInspect(_newSlaves, true, "Household Liquidators"));
diff --git a/src/markets/specificMarkets/slaveMarkets.js b/src/markets/specificMarkets/slaveMarkets.js
index fd7f1746554366569540033c269db2e9f6d6cf85..bb9813de0e926b13ba5a405418a9b0f27fa6051b 100644
--- a/src/markets/specificMarkets/slaveMarkets.js
+++ b/src/markets/specificMarkets/slaveMarkets.js
@@ -192,23 +192,23 @@ App.Markets.raiders = function() {
 	return el;
 };
 
-App.Markets.neighbor = function(numArcology) {
+App.Markets.neighbor = function() {
 	const el = new DocumentFragment();
 	let r = [];
-	r.push(`You're in the area of the slave market that specializes in slaves from within the Free City, viewing slaves from <span class="bold>${V.arcologies[numArcology].name}.</span> Some were trained there, specifically for sale, while others are simply being sold.`);
-	let _opinion = App.Neighbor.opinion(0, numArcology);
+	r.push(`You're in the area of the slave market that specializes in slaves from within the Free City, viewing slaves from <span class="bold>${V.arcologies[V.market.numArcology].name}.</span> Some were trained there, specifically for sale, while others are simply being sold.`);
+	let _opinion = App.Neighbor.opinion(0, V.market.numArcology);
 	let costMod = 1;
 	if (_opinion !== 0) {
 		if (_opinion > 2) {
-			r.push(`Your cultural ties with ${V.arcologies[numArcology].name} helps keep the price reasonable.`);
+			r.push(`Your cultural ties with ${V.arcologies[V.market.numArcology].name} helps keep the price reasonable.`);
 		} else if (_opinion < -2) {
-			r.push(`Your social misalignment with ${V.arcologies[numArcology].name} drives up the price.`);
+			r.push(`Your social misalignment with ${V.arcologies[V.market.numArcology].name} drives up the price.`);
 		}
 		costMod = (1 - (_opinion * 0.05));
 	}
 
 	el.append(r.join(" "));
-	el.append(App.Markets.purchaseFramework("neighbor", {numArcology: numArcology, costMod:costMod}));
+	el.append(App.Markets.purchaseFramework("neighbor", {costMod:costMod}));
 	return el;
 };
 
diff --git a/src/markets/theMarket/buySlaves.js b/src/markets/theMarket/buySlaves.js
index da6ecf056e3aeeae2b345d21f37422bc0127cc87..d4ab44e45d9879b5efb35fe3cd25aaa60c363ae9 100644
--- a/src/markets/theMarket/buySlaves.js
+++ b/src/markets/theMarket/buySlaves.js
@@ -67,12 +67,10 @@ App.UI.buySlaves = function() {
 					App.UI.DOM.link(
 						"Slaves from",
 						() => {
-							V.market = {
-								market: "neighbor",
-								slaveMarket: 0,
-								newSlaves: [],
-								numArcology: _i
-							};
+							V.market = new App.Markets.GlobalVariable();
+							V.market.slaveMarket = "neighbor";
+							V.market.newSlaves = [];
+							V.market.numArcology = _i;
 							updateNav();
 						},
 						[],
@@ -86,10 +84,11 @@ App.UI.buySlaves = function() {
 						App.UI.DOM.link(
 							"x5",
 							() => {
-								V.slaveMarket = "neighbor";
-								V.introType = "bulk";
-								V.numSlaves = 5;
-								V.numArcology = _i;
+								V.market = new App.Markets.GlobalVariable();
+								V.market.slaveMarket = "neighbor";
+								V.market.introType = "bulk";
+								V.market.numSlaves = 5;
+								V.market.numArcology = _i;
 							},
 							[],
 							"Slave Markets"
@@ -101,10 +100,11 @@ App.UI.buySlaves = function() {
 						App.UI.DOM.link(
 							"x10",
 							() => {
-								V.slaveMarket = "neighbor";
-								V.introType = "bulk";
-								V.numSlaves = 10;
-								V.numArcology = _i;
+								V.market = new App.Markets.GlobalVariable();
+								V.market.slaveMarket = "neighbor";
+								V.market.introType = "bulk";
+								V.market.numSlaves = 10;
+								V.market.numArcology = _i;
 							},
 							[],
 							"Slave Markets"
@@ -149,12 +149,10 @@ App.UI.buySlaves = function() {
 				App.UI.DOM.link(
 					store.title,
 					() => {
-						V.market = {
-							market: store.marketType,
-							slaveMarket: 0,
-							newSlaves: [],
-							numArcology: 1
-						};
+						V.market = new App.Markets.GlobalVariable();
+						V.market.slaveMarket = store.marketType;
+						V.market.newSlaves = [];
+						V.market.numArcology = 1;
 						updateNav();
 					},
 					[],
@@ -168,9 +166,9 @@ App.UI.buySlaves = function() {
 					App.UI.DOM.link(
 						`x5`,
 						() => {
-							V.slaveMarket = store.marketType;
-							V.introType = "bulk";
-							V.numSlaves = 5;
+							V.market = new App.Markets.GlobalVariable();
+							V.market.slaveMarket = store.marketType;
+							V.market.numSlaves = 5;
 						},
 						[],
 						`Bulk Slave Generate`
@@ -182,9 +180,9 @@ App.UI.buySlaves = function() {
 					App.UI.DOM.link(
 						`x10`,
 						() => {
-							V.slaveMarket = store.marketType;
-							V.introType = "bulk";
-							V.numSlaves = 10;
+							V.market.slaveMarket = store.marketType;
+							V.market.introType = "bulk";
+							V.market.numSlaves = 10;
 						},
 						[],
 						`Bulk Slave Generate`
diff --git a/src/npc/generate/newSlaveIntro.js b/src/npc/generate/newSlaveIntro.js
index 624d1b442123b4d56c40ed81f993994f816d38eb..f4954f90b0792b4648d3873604685b56cca6cce8 100644
--- a/src/npc/generate/newSlaveIntro.js
+++ b/src/npc/generate/newSlaveIntro.js
@@ -24,6 +24,8 @@ App.UI.newSlaveIntro = function(slave, slave2 = V.eventSlave) {
 
 	el.append(choices());
 
+	App.Utils.scheduleSidebarRefresh(); // Sidebar endWeek button is baked in sometimes. Make sure it refreshes.
+
 	return el;
 
 	/**
@@ -859,7 +861,7 @@ App.UI.newSlaveIntro = function(slave, slave2 = V.eventSlave) {
 					)
 				);
 				if (slave.devotion <= 20) {
-					div.append(`Will not apply many cosmetic and surgical options since ${he} is not obedient`);
+					div.append(` Will not apply many cosmetic and surgical options since ${he} is not obedient`);
 				}
 				el.append(div);
 			}
diff --git a/src/player/electiveSurgery.tw b/src/player/electiveSurgery.tw
index 92030963c776635b85ffe303f16d1bf29fc8ab6d..945eae70c5008d62de38b765e3f72a600488f700 100644
--- a/src/player/electiveSurgery.tw
+++ b/src/player/electiveSurgery.tw
@@ -211,13 +211,13 @@ You have @@.orange;$PC.skin skin.@@<<if $PC.skin != $PC.origSkin>> Your original
 <<if $PC.belly >= 100 && $PC.preg > 3>>
 	<br><br>_HeU darts for your middle.
 	<<if $PC.belly >= 120000>>
-		"My god! What happened to you? You might now want to hit the fertility drugs so hard next time. Then again, I don't think you'll see us complaining when you come in for a tummy tuck to get everything back where it used to be," _heU says with a wink as _heU uses both hands to massage your
+		"My god! What happened to you? You might not want to hit the fertility drugs so hard next time. Then again, I don't think you'll see us complaining when you come in for a tummy tuck to get everything back where it used to be," _heU says with a wink as _heU uses both hands to massage your
 		<<if $PC.preg > 40>>overdue <<print pregNumberName($PC.pregType, 1)>>-bursting belly, enjoying the kicks from your child<<if $PC.pregType > 1>>ren<</if>> within. "If you go into labor, we have everything you'll need, so don't worry."
 		<<else>>over-crowded belly.
 		<</if>>
 		<br>
 	<<elseif $PC.belly >= 110000>>
-		"My god! What happened to you? You might now want to hit the fertility drugs so hard next time. Then again, I don't think you'll see us complaining when you come in for a tummy tuck to get everything back where it used to be," _heU says with a wink as _heU uses both hands to massage your
+		"My god! What happened to you? You might not want to hit the fertility drugs so hard next time. Then again, I don't think you'll see us complaining when you come in for a tummy tuck to get everything back where it used to be," _heU says with a wink as _heU uses both hands to massage your
 		<<if $PC.preg > 40>>overdue <<print pregNumberName($PC.pregType, 1)>>-stuffed belly, enjoying the kicks from your child<<if $PC.pregType > 1>>ren<</if>> within. "If you go into labor, we have everything you'll need, so don't worry."
 		<<else>>over-crowded belly.
 		<</if>>
diff --git a/src/pregmod/FCTV/FCTVshows.js b/src/pregmod/FCTV/FCTVshows.js
index f9b01ce63e6fd5d89bb07ffa6590103f8abb231a..57aca3496cb43739ac05771cfb51a418764b42cb 100644
--- a/src/pregmod/FCTV/FCTVshows.js
+++ b/src/pregmod/FCTV/FCTVshows.js
@@ -810,7 +810,7 @@ App.Data.FCTV.channels = {
 				get slaves() { return [App.Data.FCTV.actors.premiumVirgin]; },
 				text: function(slave) {
 					const {He, he} = getPronouns(slave);
-					return `<p>Next up, we have a premium virgin named ${slave.slaveName}." A bright pink "VV" symbol flashes on the corner of the screen. "Take a good look, because ${he} is a product of the famous sex slave breeding program at Arcturus Arcology. Like all the slaves they sell, ${he}'s a premium <span class="pink">double virgin.</span> ${He} has excellent breeding potential, and while ${he} isn't that skilled yet, ${he}'s got good intelligence and is already well acclimated to the life of a sex slave."</p>`;
+					return `<p>"Next up, we have a premium virgin named ${slave.slaveName}." A bright pink "VV" symbol flashes on the corner of the screen. "Take a good look, because ${he} is a product of the famous sex slave breeding program at Arcturus Arcology. Like all the slaves they sell, ${he}'s a premium <span class="pink">double virgin.</span> ${He} has excellent breeding potential, and while ${he} isn't that skilled yet, ${he}'s got good intelligence and is already well acclimated to the life of a sex slave."</p>`;
 				}
 			},
 			{// hyperpregnant
@@ -819,7 +819,7 @@ App.Data.FCTV.channels = {
 				text: function(slave) {
 					const r = [];
 					const {his, he, him} = getPronouns(slave);
-					r.push(`<p>Next up, we have ${addA(slave.race)} breeder, young and healthy with an advanced`);
+					r.push(`<p>"Next up, we have ${addA(slave.race)} breeder, young and healthy with an advanced`);
 					if (V.seeHyperPreg === 0) {
 						r.push(`<i><span class="pink">super pregnancy.</span></i>`);
 					} else {
@@ -835,7 +835,7 @@ App.Data.FCTV.channels = {
 				text: function(slave) {
 					const r = [];
 					const {girl, his, He, he, him} = getPronouns(slave);
-					r.push(`<p>Next up, we have a special slave named ${slave.slaveName} who has quite the gift, <span class="pink">superfetation!</span> ${He} can become pregnant while pregnant! Isn't that amazing? ${He} may have a few miles on ${him}, having just completed a double pregnancy, but with a trait like that, ${he}'s more than worth ${his} price if you like your ${girl}s to constantly have a bun in the oven."</p>`);
+					r.push(`<p>"Next up, we have a special slave named ${slave.slaveName} who has quite the gift, <span class="pink">superfetation!</span> ${He} can become pregnant while pregnant! Isn't that amazing? ${He} may have a few miles on ${him}, having just completed a double pregnancy, but with a trait like that, ${he}'s more than worth ${his} price if you like your ${girl}s to constantly have a bun in the oven."</p>`);
 					return r.join(" ");
 				}
 			},
@@ -845,11 +845,11 @@ App.Data.FCTV.channels = {
 				text: function(slave) {
 					const r = [];
 					const {He, he} = getPronouns(slave);
-					r.push(`<p>Next up, we have ${addA(slave.race)} <span class="pink">MILF.</span> ${He}'s no longer young, but still quite attractive. ${He} has been a slave for many years now, and has been trained well. ${He} also has a good array of skills that you can put to use. ${He} has huge tits and a huge ass to play with, but ${he}'d also make good`);
+					r.push(`<p>"Next up, we have ${addA(slave.race)} <span class="pink">MILF.</span> ${He}'s no longer young, but still quite attractive. ${He} has been a slave for many years now, and has been trained well. ${He} also has a good array of skills that you can put to use. ${He} has huge tits and a huge ass to play with, but ${he}'d also make good`);
 					if (V.seePreg === 0) {
-						r.push(`<i>sandwiches</i>.</p>`);
+						r.push(`<i>sandwiches</i>."</p>`);
 					} else {
-						r.push(`stock for a breeding program.</p>`);
+						r.push(`stock for a breeding program."</p>`);
 					}
 					return r.join(" ");
 				}
@@ -860,7 +860,7 @@ App.Data.FCTV.channels = {
 				text: function(slave) {
 					const r = [];
 					const {girl, his, he, him} = getPronouns(slave);
-					r.push(`<p>Next up, we have a bargain discount offer on a young ${slave.race} ${girl}. Unlike our usual stock ${he}'s something of a <span class="red">disobedient</span> slave, but that means savings for you, and all the fun of breaking in a new slave. We have to admit that ${his} previous owner had a hard time training ${him}, but I'm sure you can tell that ${his} body has`);
+					r.push(`<p>"Next up, we have a bargain discount offer on a young ${slave.race} ${girl}. Unlike our usual stock ${he}'s something of a <span class="red">disobedient</span> slave, but that means savings for you, and all the fun of breaking in a new slave. We have to admit that ${his} previous owner had a hard time training ${him}, but I'm sure you can tell that ${his} body has`);
 					if (slave.clit > 4) {
 						r.push(`potential, just look at the <span class="pink">clit</span> on ${him}!"</p>`);
 					} else {
@@ -876,7 +876,7 @@ App.Data.FCTV.channels = {
 				text: function(slave) {
 					const r = [];
 					const {his, He} = getPronouns(slave);
-					r.push(`<p>Next up, we have ${addA(slave.race)} cum cow. Just take a look at that pair of <span class="pink">massive balls.</span> This slave also has a prostate stimulating hormone implant to ramp up ${his} cum production even further. ${He}'s a perfect fit for your dairy, or even your own kitchen creamery!"</p>`);
+					r.push(`<p>"Next up, we have ${addA(slave.race)} cum cow. Just take a look at that pair of <span class="pink">massive balls.</span> This slave also has a prostate stimulating hormone implant to ramp up ${his} cum production even further. ${He}'s a perfect fit for your dairy, or even your own kitchen creamery!"</p>`);
 					r.push(`<p>The woman helping to display the slaves shows her hand to the camera; it's coated in a sticky layer of precum from handling the cum cow's equipment.</p>`);
 					return r.join(" ");
 				}
@@ -886,7 +886,7 @@ App.Data.FCTV.channels = {
 				get slaves() { return [App.Data.FCTV.actors.mpreg]; },
 				text: function(slave) {
 					const {girl, his, he, him} = getPronouns(slave);
-					return `<p>Next up, we have a strong young ${slave.race} ${girl} that retains ${his} cock and balls. ${slave.slaveName} has something that makes ${him} special: thanks to medical science ${he}'s got a <span class="pink">functional ass womb.</span> That's right folks, this slave is fertile and can get knocked up if you inseminate ${his} asshole. That's pretty amazing, to be honest, and exceptionally rare. Don't let this opportunity slip by!"</p>`;
+					return `<p>"Next up, we have a strong young ${slave.race} ${girl} that retains ${his} cock and balls. ${slave.slaveName} has something that makes ${him} special: thanks to medical science ${he}'s got a <span class="pink">functional ass womb.</span> That's right folks, this slave is fertile and can get knocked up if you inseminate ${his} asshole. That's pretty amazing, to be honest, and exceptionally rare. Don't let this opportunity slip by!"</p>`;
 				}
 			},
 		]
diff --git a/src/pregmod/theBlackMarket.tw b/src/pregmod/theBlackMarket.tw
index 184bc3f4f5b434042ab6efcc03f14e29f4ba17e2..8006bb412fb0afd7f09c05ebcbe7953c6f348378 100644
--- a/src/pregmod/theBlackMarket.tw
+++ b/src/pregmod/theBlackMarket.tw
@@ -32,12 +32,12 @@ There is quite the selection of refreshments available, you could always shift y
 <<if $arcologies[0].FSPaternalist != "unset">>
 	<br><br>
 	A convoy of scientists from the banned wetware CPU project are present and selling their leftover wares.
-	[[Browse CPUs|Slave Markets][$slaveMarket = "wetware", $slavesSeen += 1]] |
+	[[Browse CPUs|Slave Markets][$market.slaveMarket = "wetware", $slavesSeen += 1]] |
 	<<if $cash > _minimumFive>>
-		[[(x5)|Bulk Slave Generate][$slaveMarket = "wetware", $introType = "bulk", $numSlaves = 5]] |
+		[[(x5)|Bulk Slave Generate][$market.slaveMarket = "wetware", $market.introType = "bulk", $market.numSlaves = 5]] |
 	<</if>>
 	<<if $cash > _minimumTen>>
-		[[(x10)|Bulk Slave Generate][$slaveMarket = "wetware", $introType = "bulk", $numSlaves = 10]] |
+		[[(x10)|Bulk Slave Generate][$market.slaveMarket = "wetware", $market.introType = "bulk", $market.numSlaves = 10]] |
 	<</if>>
 <</if>>
 */
diff --git a/src/uncategorized/bulkSlaveGenerate.tw b/src/uncategorized/bulkSlaveGenerate.tw
index 69ec4dae50edca772c7b5257afe564b58c630dd1..df6d83a2b8f26483ff93809778375f3ec1c00f04 100644
--- a/src/uncategorized/bulkSlaveGenerate.tw
+++ b/src/uncategorized/bulkSlaveGenerate.tw
@@ -1,14 +1,14 @@
 :: Bulk Slave Generate [nobr]
 
-<<set $newSlaves = [], $returnTo = "Main", $newSlavesDone = 0, $spent = 0, $newSlaveIndex = 0>>
+<<set $returnTo = "Main", $market.newSlaves = [], $market.newSlavesDone = 0, $market.newSlaveIndex = 0, $market.introType = "bulk", $spent = 0>>
 
-<<if ndef $numSlaves>>
-	<<set $numSlaves = 5>>
+<<if ndef $market.numSlaves>>
+	<<set $market.numSlaves = 5>>
 <</if>>
 
 /* Discount calculation. Gives 5% on top of slave school discount */
 <<set $discount = 475>>
-<<switch $slaveMarket>>
+<<switch $market.slaveMarket>>
 <<case "TSS">>
 	<<if $TSS.schoolUpgrade != 0>>
 		<<set $discount = 375>>
@@ -67,23 +67,23 @@
 	<</if>>
 
 <<case "neighbor">>
-	<<if $numArcology >= $arcologies.length>>
-		<<set $numArcology = 1>>
+	<<if $market.numArcology >= $arcologies.length>>
+		<<set $market.numArcology = 1>>
 	<</if>>
-	<<set _opinion = App.Neighbor.opinion(0, $numArcology)>>
+	<<set _opinion = App.Neighbor.opinion(0, $market.numArcology)>>
 	<<set _opinion = Math.clamp(Math.trunc(_opinion/20), -10, 10)>>
 	<<set $discount -= (_opinion * 25)>>
 
 <</switch>>
 
-<<for _i = 0; _i < $numSlaves; _i++>>
-	<<set $activeSlave = (generateMarketSlave($slaveMarket, $numArcology)).slave>>
+<<for _i = 0; _i < $market.numSlaves; _i++>>
+	<<set $activeSlave = (generateMarketSlave($market.slaveMarket, $market.numArcology)).slave>>
 	<<set $slavesSeen++>>
-	<<if App.Data.misc.lawlessMarkets.includes($slaveMarket)>>
+	<<if App.Data.misc.lawlessMarkets.includes($market.slaveMarket)>>
 		<<set _slaveCost = slaveCost($activeSlave)>>
 	<<else>>
 		<<set _backup = $activeSlave>> /* backup newly generated slave */
-		<<run App.Desc.lawCompliance($activeSlave, $slaveMarket)>> /* includes CheckForGingering — slave stats may change, affecting price */
+		<<run App.Desc.lawCompliance($activeSlave, $market.slaveMarket)>> /* includes CheckForGingering — slave stats may change, affecting price */
 		<<set _slaveCost = slaveCost($activeSlave)>>
 		<<run removeGingering()>> /* remove gingered state, if applied, so we can apply it again later */
 		<<set $activeSlave = _backup>> /* restore backup so we can apply Law Compliance again later */
@@ -92,7 +92,7 @@
 	/* Adjust _slaveCost according to $slavesSeen */
 	<<if $slavesSeen > $slaveMarketLimit>>
 		<<set _slaveCost += _slaveCost*(($slavesSeen-$slaveMarketLimit)*0.1)>>
-		<<if $introType == "inStock">>
+		<<if $market.introType == "inStock">>
 			<<break>>
 		<</if>>
 	<</if>>
@@ -102,42 +102,42 @@
 
 	/* Charge the Player for the slave, or break out if cannot afford */
 	<<if $cash < _slaveCost>>
-		<<set _i = $numSlaves>>
+		<<set _i = $market.numSlaves>>
 		<<break>>
 	<<else>>
 		<<run cashX(forceNeg(_slaveCost), "slaveTransfer", $activeSlave)>>
-		<<set $newSlaves.push($activeSlave)>>
+		<<set $market.newSlaves.push($activeSlave)>>
 		<<set $spent += _slaveCost>>
 	<</if>>
 <</for>>
 
 /* Max Buy clean-up */
-<<if $numSlaves == 9999>>
-	<<set $numSlaves = $newSlaves.length>>
+<<if $market.numSlaves == 9999>>
+	<<set $market.numSlaves = $market.newSlaves.length>>
 <</if>>
 
 /* increment Slave school purchase counts if needed */
-<<switch $slaveMarket>>
+<<switch $market.slaveMarket>>
 <<case "TSS">>
-	<<set $TSS.studentsBought += $newSlaves.length>>
+	<<set $TSS.studentsBought += $market.newSlaves.length>>
 <<case "TUO">>
-	<<set $TUO.studentsBought += $newSlaves.length>>
+	<<set $TUO.studentsBought += $market.newSlaves.length>>
 <<case "GRI">>
-	<<set $GRI.studentsBought += $newSlaves.length>>
+	<<set $GRI.studentsBought += $market.newSlaves.length>>
 <<case "SCP">>
-	<<set $SCP.studentsBought += $newSlaves.length>>
+	<<set $SCP.studentsBought += $market.newSlaves.length>>
 <<case "LDE">>
-	<<set $LDE.studentsBought += $newSlaves.length>>
+	<<set $LDE.studentsBought += $market.newSlaves.length>>
 <<case "TGA">>
-	<<set $TGA.studentsBought += $newSlaves.length>>
+	<<set $TGA.studentsBought += $market.newSlaves.length>>
 <<case "HA">>
-	<<set $HA.studentsBought += $newSlaves.length>>
+	<<set $HA.studentsBought += $market.newSlaves.length>>
 <<case "TCR">>
-	<<set $TCR.studentsBought += $newSlaves.length>>
+	<<set $TCR.studentsBought += $market.newSlaves.length>>
 <<case "TFS">>
-	<<set $TFS.studentsBought += $newSlaves.length>>
+	<<set $TFS.studentsBought += $market.newSlaves.length>>
 <<case "NUL">>
-	<<set $NUL.studentsBought += $newSlaves.length>>
+	<<set $NUL.studentsBought += $market.newSlaves.length>>
 <</switch>>
 
 <<goto "Bulk Slave Intro">>
diff --git a/src/uncategorized/bulkSlaveIntro.tw b/src/uncategorized/bulkSlaveIntro.tw
index 08d4abac42513ccf093712e43bd528d59895ae4c..5651355cbe855df37efda95182ec058b07cd2b82 100644
--- a/src/uncategorized/bulkSlaveIntro.tw
+++ b/src/uncategorized/bulkSlaveIntro.tw
@@ -1,34 +1,34 @@
 :: Bulk Slave Intro [nobr]
 
-<<if ndef $introType || $newSlaves.length == 0>>
-	<<set $introType = "">>
+<<if ndef $market.introType || $market.newSlaves.length == 0>>
+	<<set $market.introType = "">>
 <</if>>
-<<if isNaN($newSlaveIndex)>>
-	<<set $newSlaveIndex = 0>>
+<<if isNaN($market.newSlaveIndex)>>
+	<<set $market.newSlaveIndex = 0>>
 <</if>>
 
-<<switch $introType>>
+<<switch $market.introType>>
 <<case "">>
 	/* No message to give */
 <<case "multi">>
-	<<if $newSlaves.length > 1>>
-		Your selection of $newSlaves.length slaves arrives from <<MarketNamePeriod $slaveMarket $numArcology>>
+	<<if $market.newSlaves.length > 1>>
+		Your selection of $market.newSlaves.length slaves arrives from <<MarketNamePeriod $market.slaveMarket $market.numArcology>>
 	<<else>>
-		Your new slave from <<MarketName $slaveMarket $numArcology>> has arrived.
+		Your new slave from <<MarketName $market.slaveMarket $market.numArcology>> has arrived.
 	<</if>>
 
 <<case "bulk">>
-	Your delivery of $newSlaves.length slaves arrives from <<MarketNamePeriod $slaveMarket $numArcology>>
-	<<if $newSlaves.length != $numSlaves>>
-		You were going to order $numSlaves, but $assistant.name lowered it on financial grounds.
+	Your delivery of $market.newSlaves.length slaves arrives from <<MarketNamePeriod $market.slaveMarket $market.numArcology>>
+	<<if $market.newSlaves.length != $market.numSlaves>>
+		You were going to order $market.numSlaves, but $assistant.name lowered it on financial grounds.
 	<</if>>
 	<<set _seed = Math.ceil($slavesSeen - $slaveMarketLimit)>>
-	<<if _seed > $newSlaves.length>>
+	<<if _seed > $market.newSlaves.length>>
 		You have cast such a wide net for slaves this week that all are more expensive than normal.
 	<<elseif _seed > 0>>
 		You have cast such a wide net for slaves this week that some (_seed) are more expensive than normal.
 	<</if>>
-	<<if $slaveMarket == "TFS">>
+	<<if $market.slaveMarket == "TFS">>
 		/* Put line about The Futanari Sisters discount & pricing */
 	<<elseif $discount == 475>>
 		Your bulk delivery came with a @@.yellowgreen;5%@@ discount.
@@ -38,8 +38,8 @@
 	You spent @@.yellowgreen;<<print cashFormat($spent)>>@@ on your new slaves.<br><br>
 
 <<case "inStock">>
-	You clear out <<MarketName $slaveMarket $numArcology>> of its stock of $newSlaves.length slaves.
-	<<if $slaveMarket == "TFS">>
+	You clear out <<MarketName $market.slaveMarket $market.numArcology>> of its stock of $market.newSlaves.length slaves.
+	<<if $market.slaveMarket == "TFS">>
 		/* Put line about The Futanari Sisters discount & pricing */
 	<<elseif $discount == 475>>
 		Your bulk delivery came with a @@.yellowgreen;5%@@ discount.
@@ -59,31 +59,31 @@
 
 <</switch>>
 /* remove the below line to make the intro blurb show up for every slave, not just the first */
-<<set $introType = "">>
+<<set $market.introType = "">>
 
-<<if ($newSlaveIndex >= $newSlaves.length) || ($newSlavesDone == 1)>>
-	<<if $newSlaves.length > 0>>
+<<if ($market.newSlaveIndex >= $market.newSlaves.length) || ($market.newSlavesDone == 1)>>
+	<<if $market.newSlaves.length > 0>>
 		/* Push the induction changes for the final slave to the newSlave array */
 		<<run newSlave($activeSlave)>>
 
 		/* Variable Clean-up */
-		<<set $newSlaves = []>>
-		<<set $newSlavesDone = 0>>
-		<<set $introType = "">>
+		<<set $market.newSlaves = []>>
+		<<set $market.newSlavesDone = 0>>
+		<<set $market.introType = "">>
 	<</if>>
 	<<goto $returnTo>>
 <<else>>
 	/* If looking at 2nd slave, push the induction changes for the prior slave to the newSlave array */
-	<<if $newSlaveIndex > 0>>
+	<<if $market.newSlaveIndex > 0>>
 		<<run newSlave($activeSlave)>>
 	<</if>>
-	<<if $newSlaves.length > 1>>
-		Showing new slave <<print $newSlaveIndex+1>> of <<print $newSlaves.length>>:
+	<<if $market.newSlaves.length > 1>>
+		Showing new slave <<print $market.newSlaveIndex+1>> of <<print $market.newSlaves.length>>:
 	<</if>>
 	<br><br>
 
 	/* Set activeSlave to the desired newSlave so that existing code can be used */
-	<<set $activeSlave = $newSlaves[$newSlaveIndex]>>
+	<<set $activeSlave = $market.newSlaves[$market.newSlaveIndex]>>
 
 	/* Due to possible gingering, the Long Slave Description must be displayed before the New Slave Intro */
 	/* policies were applied earlier, if needed */
@@ -100,12 +100,12 @@
 
 	/* Add an option = goto the next slave below the New Slave Intro section */
 	<br><br>
-	<<if $newSlaveIndex < ($newSlaves.length - 1)>>
+	<<if $market.newSlaveIndex < ($market.newSlaves.length - 1)>>
 		[[Next Slave|Bulk Slave Intro]]
 	<<else>>
-		[[Finish introducing slaves|Bulk Slave Intro][$newSlavesDone = 1]]
+		[[Finish introducing slaves|Bulk Slave Intro][$market.newSlavesDone = 1]]
 	<</if>>
 
 <</if>> /* Closes no new Slaves check */
 
-<<set $newSlaveIndex++>>
+<<set $market.newSlaveIndex++>>
diff --git a/src/uncategorized/pRivalryActions.tw b/src/uncategorized/pRivalryActions.tw
index c3fe0b013050588288e0f5eca678bccbdca452ce..a469c51ab249230dbea6b0487b575479ff0c350a 100644
--- a/src/uncategorized/pRivalryActions.tw
+++ b/src/uncategorized/pRivalryActions.tw
@@ -3341,7 +3341,7 @@ You remind yourself that success in this conflict will not be defined by the tra
 				<<else>>
 					await the bastard's arrival.
 					<br><br>
-					<<include "P rivalry capture">>
+					<<includeDOM pRivalryCapture()>>
 				<</if>>
 			<</replace>>
 		<</link>>&nbsp;&nbsp;&nbsp;&nbsp;//This option is available due to your @@.springgreen;your hacking mastery,@@ and will immediately end the conflict with a chance of enslaving your rival//
diff --git a/src/uncategorized/pRivalryCapture.js b/src/uncategorized/pRivalryCapture.js
new file mode 100644
index 0000000000000000000000000000000000000000..6b13d38f211624a9879c24ad6569ec2e72d64b38
--- /dev/null
+++ b/src/uncategorized/pRivalryCapture.js
@@ -0,0 +1,529 @@
+globalThis.pRivalryCapture = function() {
+	const el = new DocumentFragment();
+	let rivalType;
+	const slave = createRival();
+	const {his, he, him, He} = getPronouns(slave);
+	let r = [];
+	V.rivalOwner = -1;
+	V.rivalRace = 0;
+	V.rivalGender = 0;
+
+	const artDiv = document.createElement("span");
+	artDiv.id = "art-frame";
+	App.Events.drawEventArt(artDiv, slave);
+	el.append(artDiv);
+
+	r.push(`Your`);
+	if (passage() === "P rivalry actions") {
+		r.push(`target is quickly delivered. Politely dismissing the head of your ${V.mercenariesTitle}, you savor`);
+	} else {
+		r.push(`bounty is quickly claimed, and you are treated to`);
+	}
+	r.push(`the delicious moment of finding your rival on`);
+	if (hasBothLegs(slave)) {
+		r.push(`${his} knees`);
+	} else {
+		r.push(`the ground`);
+	}
+	r.push(`in front of you with a black bag over ${his} head and ${his} hands cuffed behind ${him}. ${He}'s one of your slaves now, fundamentally no different than any other. Looking ${him} over, the causes of ${his} downfall are`);
+	switch (rivalType) {
+		case "expansionist shemale":
+			r.push(`immediately apparent: ${he}'s obviously been indulging in self-transformation to excess.`);
+			break;
+		case "cum addict":
+			r.push(`immediately apparent: there's nothing wrong with having cumflation and ball expansion fetishes, but applying them to oneself can be addictive.`);
+			break;
+		case "hung shota":
+			r.push(`not immediately apparent: ${he}'s young, in good shape, and not lacking down there at all.`);
+			break;
+		case "masculine":
+			r.push(`not immediately apparent: ${he}'s in good shape, if quite masculine.`);
+			break;
+		case "micropenis":
+			r.push(`immediately apparent: ${he}'s got a slavegirl's cock and balls, not an arcology owner's.`);
+			break;
+		case "bull dyke":
+			r.push(`not immediately apparent: though female, ${he}'s obviously no stranger to taking a dominant sexual role, to put it politely.`);
+			break;
+		case "breeder":
+			r.push(`immediately apparent: there's nothing wrong with having a pregnancy fetish, but applying it to oneself is ill-fitting for an arcology owner.`);
+			break;
+		case "oppai loli":
+			r.push(`immediately apparent: ${he}'s young, inexperienced, and extremely top heavy.`);
+			break;
+		case "cow":
+			r.push(`immediately apparent: there's nothing wrong with having lactation and breast expansion fetishes, but applying them to oneself can be addictive.`);
+			break;
+		case "bimbo":
+			r.push(`immediately apparent: there's nothing wrong with having a bimbo fetish, but applying it to oneself can be addictive.`);
+			break;
+		default:
+			r.push(`immediately apparent: ${he} seems to have recently fallen into serious aphrodisiac addiction.`);
+	}
+	el.append(r.join(" "));
+
+	V.rivalID = slave.ID;
+	// proceed directly to rival initiation event after New Slave Intro
+	newSlave(slave);
+	el.append(App.UI.newSlaveIntro(slave));
+
+	V.nextLink = "P rival initiation";
+	App.Utils.scheduleSidebarRefresh();
+	return el;
+
+	/**
+	 * @returns {App.Entity.SlaveState}
+	 */
+	function createRival() {
+		let slave;
+		const rivalTypeArray = [];
+		/** @type {string} */
+		let race;
+		let minAge;
+		let maxAge;
+		let pedo;
+		if (V.rivalGender === 2) {
+			rivalTypeArray.push("expansionist shemale");
+			rivalTypeArray.push("masculine");
+			rivalTypeArray.push("micropenis");
+			rivalTypeArray.push("cum addict");
+			if (V.pedo_mode === 1) {
+				rivalTypeArray.push("hung shota");
+			}
+		} else {
+			rivalTypeArray.push("bull dyke");
+			rivalTypeArray.push("cow");
+			rivalTypeArray.push("bimbo");
+			rivalTypeArray.push("addict");
+			if (V.seePreg === 1) {
+				rivalTypeArray.push("breeder");
+			}
+			if (V.pedo_mode === 1) {
+				rivalTypeArray.push("oppai loli");
+			}
+		}
+		rivalType = rivalTypeArray.random();
+
+		if (setup.filterRacesLowercase.includes(V.rivalRace)) {
+			race = V.rivalRace;
+		}
+		switch (rivalType) {
+			case "expansionist shemale":
+				slave = GenerateNewSlave("XY", {
+					minAge: 18, maxAge: 42, race: race, disableDisability: 1
+				});
+				slave.face = 100;
+				slave.faceImplant = 15;
+				slave.faceShape = "androgynous";
+				slave.muscles = 20;
+				slave.height = random(185, 215);
+				slave.lips = 35;
+				slave.butt = either(4, 5, 6);
+				slave.boobs = either(800, 1000, 1200);
+				slave.dick = 6;
+				if (slave.foreskin > 0) {
+					slave.foreskin = slave.dick;
+				}
+				slave.balls = 10;
+				slave.anus = 3;
+				slave.vagina = -1;
+				slave.weight = 20;
+				slave.skill.oral = 100;
+				slave.skill.anal = 100;
+				slave.skill.whoring = 15;
+				slave.skill.entertainment = 100;
+				slave.skill.combat = 0;
+				slave.clitPiercing = 2;
+				slave.nipplesPiercing = 1;
+				slave.earPiercing = 1;
+				slave.tonguePiercing = 1;
+				slave.eyebrowPiercing = 1;
+				slave.behavioralFlaw = "odd";
+				slave.behavioralQuirk = "confident";
+				slave.sexualFlaw = "judgemental";
+				slave.sexualQuirk = "romantic";
+				slave.hStyle = "luxurious";
+				slave.hLength = 80;
+				break;
+			case "cum addict":
+				slave = GenerateNewSlave("XY", {
+					minAge: 18, maxAge: 42, race: race, disableDisability: 1
+				});
+				slave.chem = 3000;
+				slave.face = 100;
+				slave.faceShape = "masculine";
+				slave.muscles = 100;
+				slave.height = random(185, 215);
+				slave.lips = 10;
+				slave.butt = 10;
+				slave.boobs = either(100, 200);
+				slave.dick = 6;
+				slave.foreskin = 0;
+				slave.balls = 300;
+				slave.scrotum = 280;
+				slave.anus = 3;
+				slave.vagina = -1;
+				slave.weight = -35;
+				slave.skill.oral = 0;
+				slave.skill.anal = 100;
+				slave.skill.whoring = 15;
+				slave.skill.entertainment = 100;
+				slave.skill.combat = 0;
+				slave.dickPiercing = 2;
+				slave.fetish = "pregnancy";
+				slave.fetishStrength = 100;
+				slave.behavioralFlaw = "odd";
+				slave.behavioralQuirk = "confident";
+				slave.sexualFlaw = "cum addict";
+				slave.sexualQuirk = "size queen";
+				slave.hStyle = "neat";
+				slave.hLength = 20;
+				break;
+			case "hung shota":
+				slave = GenerateNewSlave("XY", {
+					minAge: V.minimumSlaveAge, maxAge: 42, race: race, disableDisability: 1
+				});
+				slave.face = 100;
+				slave.faceShape = "androgynous";
+				slave.muscles = 0;
+				slave.lips = 10;
+				slave.butt = 0;
+				slave.boobs = either(100, 200);
+				slave.dick = 6;
+				slave.foreskin = slave.dick;
+				slave.balls = 6;
+				slave.scrotum = 6;
+				slave.anus = 0;
+				slave.vagina = -1;
+				slave.weight = -35;
+				slave.skill.oral = 0;
+				slave.skill.anal = 0;
+				slave.skill.whoring = 0;
+				slave.skill.entertainment = 100;
+				slave.skill.combat = 0;
+				slave.dickPiercing = 2;
+				slave.pubertyXY = 1;
+				slave.fetish = "pregnancy";
+				slave.fetishStrength = 100;
+				slave.behavioralFlaw = "hates men";
+				slave.behavioralQuirk = "adores women";
+				slave.sexualFlaw = "shamefast";
+				slave.sexualQuirk = "perverted";
+				slave.hLength = 20;
+				break;
+			case "masculine":
+				slave = GenerateNewSlave("XY", {
+					minAge: 18, maxAge: 42, race: race, disableDisability: 1
+				});
+				slave.face = 55;
+				slave.faceImplant = 0;
+				slave.faceShape = "masculine";
+				slave.muscles = either(20, 50, 100);
+				slave.height = random(185, 195);
+				slave.butt = either(2, 3);
+				slave.boobs = either(100, 200);
+				slave.dick = 5;
+				if (slave.foreskin > 0) {
+					slave.foreskin = slave.dick;
+				}
+				slave.balls = 5;
+				slave.anus = 0;
+				slave.vagina = -1;
+				slave.weight = 0;
+				slave.skill.vaginal = 0;
+				slave.skill.oral = 15;
+				slave.skill.anal = 0;
+				slave.skill.whoring = 0;
+				slave.skill.entertainment = 15;
+				slave.skill.combat = 1;
+				slave.behavioralFlaw = "hates men";
+				slave.behavioralQuirk = "fitness";
+				slave.sexualFlaw = "hates anal";
+				slave.sexualQuirk = "perverted";
+				slave.hStyle = "neat";
+				slave.hLength = 5;
+				break;
+			case "micropenis":
+				slave = GenerateNewSlave("XY", {
+					minAge: 18, maxAge: 42, race: race, disableDisability: 1
+				});
+				slave.face = 55;
+				slave.faceImplant = 0;
+				slave.faceShape = "masculine";
+				slave.muscles = 0;
+				slave.height = random(145, 160);
+				slave.butt = either(2, 4);
+				slave.boobs = either(100, 400);
+				slave.dick = 1;
+				if (slave.foreskin > 0) {
+					slave.foreskin = slave.dick;
+				}
+				slave.balls = 2;
+				slave.anus = 1;
+				slave.vagina = -1;
+				slave.weight = 100;
+				slave.skill.vaginal = 0;
+				slave.skill.oral = 15;
+				slave.skill.anal = 15;
+				slave.skill.whoring = 0;
+				slave.skill.entertainment = 15;
+				slave.skill.combat = 0;
+				slave.behavioralFlaw = "hates men";
+				slave.behavioralQuirk = "insecure";
+				slave.sexualFlaw = "shamefast";
+				slave.sexualQuirk = "perverted";
+				slave.hStyle = "neat";
+				slave.hLength = 5;
+				break;
+			case "bull dyke":
+				slave = GenerateNewSlave("XX", {
+					minAge: 18, maxAge: 42, race: race, disableDisability: 1
+				});
+				slave.face = 55;
+				slave.faceImplant = 0;
+				slave.faceShape = "androgynous";
+				slave.muscles = 100;
+				slave.height = random(185, 195);
+				slave.lipsImplant = 10;
+				slave.lips = 35;
+				slave.buttImplant = 1;
+				slave.butt += slave.buttImplant;
+				slave.buttImplantType = "normal";
+				slave.boobs -= 100;
+				slave.boobsImplant = either(400, 600, 800);
+				slave.boobs += slave.boobsImplant;
+				slave.boobsImplantType = "normal";
+				slave.clit = 2;
+				slave.anus = 1;
+				slave.vagina = 1;
+				slave.preg = -1;
+				slave.skill.vaginal = 15;
+				slave.skill.oral = 0;
+				slave.skill.anal = 15;
+				slave.skill.whoring = 0;
+				slave.skill.entertainment = 0;
+				slave.skill.combat = 1;
+				slave.clitPiercing = 1;
+				slave.earPiercing = 1;
+				slave.behavioralFlaw = "hates men";
+				slave.behavioralQuirk = "fitness";
+				slave.sexualFlaw = "hates penetration";
+				slave.sexualQuirk = "unflinching";
+				slave.hStyle = "neat";
+				slave.hLength = 5;
+				break;
+			case "breeder":
+				if (V.pedo_mode === 1) {
+					minAge = (V.fertilityAge + 6);
+					pedo = 1;
+					/* Old enough to have been pregnant many times. */
+				} else {
+					minAge = 18;
+					maxAge = 42;
+				}
+				slave = GenerateNewSlave("XX", {
+					minAge: minAge, maxAge: maxAge, ageOverridesPedoMode: pedo, race: race, disableDisability: 1
+				});
+				slave.pubertyXX = 1;
+				slave.face = 100;
+				slave.faceImplant = 0;
+				slave.faceShape = "sensual";
+				slave.muscles = 50;
+				slave.lips = 35;
+				slave.butt = either(6, 7, 8);
+				slave.boobs = 5000;
+				slave.nipples = "huge";
+				slave.lactation = 1;
+				slave.lactationDuration = 2;
+				slave.anus = 1;
+				slave.preg = 25;
+				if (V.seeHyperPreg === 1) {
+					slave.geneticQuirks.uterineHypersensitivity = 2;
+					slave.vagina = 10;
+					slave.pregType = random(20, 35);
+					slave.counter.birthsTotal = random(120, 180);
+					slave.bellySag = 30;
+					slave.bellySagPreg = 30;
+					slave.pregAdaptation = slave.counter.birthsTotal * 2;
+				} else {
+					const UHSchance = Math.random();
+					if (UHSchance > 0.9) {
+						slave.geneticQuirks.uterineHypersensitivity = 2;
+					} else if (UHSchance > 0.6 && slave.geneticQuirks.uterineHypersensitivity !== 2) {
+						slave.geneticQuirks.uterineHypersensitivity = 1;
+					}
+					slave.vagina = 5;
+					slave.pregType = either(3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8);
+					slave.counter.birthsTotal = random(18, 27);
+					slave.bellySag = 2;
+					slave.bellySagPreg = 2;
+					slave.pregAdaptation = (random(60, 100) + (slave.counter.birthsTotal * slave.geneticQuirks.uterineHypersensitivity));
+				}
+				slave.pregKnown = 1;
+				slave.pregWeek = slave.preg;
+				SetBellySize(slave);
+				slave.skill.vaginal = 100;
+				slave.skill.oral = 15;
+				slave.skill.anal = 15;
+				slave.skill.whoring = 35;
+				slave.skill.entertainment = 15;
+				slave.skill.combat = 0;
+				slave.fetish = "pregnancy";
+				slave.fetishStrength = 1000;
+				slave.behavioralFlaw = "odd";
+				slave.behavioralQuirk = "adores men";
+				slave.sexualFlaw = "breeder";
+				slave.sexualQuirk = "caring";
+				slave.hStyle = "luxurious";
+				slave.hLength = 80;
+				break;
+			case "oppai loli":
+				slave = GenerateNewSlave("XX", {
+					minAge: V.minimumSlaveAge, maxAge: 12, race: race, disableDisability: 1
+				});
+				slave.face = 100;
+				slave.faceImplant = 0;
+				slave.faceShape = "cute";
+				slave.muscles = 20;
+				slave.weight = 60;
+				slave.lips = 10;
+				slave.butt = 1;
+				slave.hips = -1;
+				slave.shoulders = -2;
+				slave.boobs = 7000;
+				slave.nipples = "huge";
+				slave.anus = 0;
+				slave.vagina = 0;
+				slave.preg = 0;
+				slave.skill.vaginal = 0;
+				slave.skill.oral = 0;
+				slave.skill.anal = 0;
+				slave.skill.whoring = 0;
+				slave.skill.entertainment = 15;
+				slave.skill.combat = 0;
+				slave.behavioralFlaw = "odd";
+				slave.behavioralQuirk = "insecure";
+				slave.sexualFlaw = "shamefast";
+				slave.sexualQuirk = "tease";
+				slave.hStyle = "twin tails";
+				slave.hLength = 40;
+				break;
+			case "cow":
+				slave = GenerateNewSlave("XX", {
+					minAge: 18, maxAge: 42, race: race, disableDisability: 1
+				});
+				slave.face = 55;
+				slave.faceImplant = 0;
+				slave.faceShape = "cute";
+				slave.muscles = 50;
+				slave.height = random(185, 195);
+				slave.lips = 35;
+				slave.butt = either(6, 7, 8);
+				slave.boobs = 30000;
+				slave.weight = random(100, 160);
+				slave.nipples = "huge";
+				slave.lactation = 2;
+				slave.lactationDuration = 2;
+				slave.anus = 1;
+				slave.vagina = 2;
+				slave.preg = 0;
+				slave.skill.vaginal = 15;
+				slave.skill.oral = 15;
+				slave.skill.anal = 0;
+				slave.skill.whoring = 0;
+				slave.skill.entertainment = 15;
+				slave.skill.combat = 0;
+				slave.behavioralFlaw = "odd";
+				slave.behavioralQuirk = "insecure";
+				slave.sexualFlaw = "breast growth";
+				slave.sexualQuirk = "perverted";
+				slave.hStyle = "neat";
+				slave.hLength = 5;
+				break;
+			case "bimbo":
+				slave = GenerateNewSlave("XX", {
+					minAge: 18, maxAge: 42, race: race, disableDisability: 1
+				});
+				slave.face = 100;
+				slave.faceImplant = 65;
+				slave.faceShape = "sensual";
+				slave.muscles = 0;
+				slave.height = random(180, 190);
+				slave.lipsImplant = 2;
+				slave.lips = random(25, 55);
+				slave.buttImplant = 2;
+				slave.butt += slave.buttImplant;
+				slave.buttImplantType = "normal";
+				slave.boobsImplant = either(600, 800, 1000);
+				slave.boobs += slave.boobsImplant;
+				slave.boobsImplantType = "normal";
+				slave.anus = 2;
+				slave.vagina = 1;
+				slave.preg = -1;
+				slave.skill.vaginal = 100;
+				slave.skill.oral = 100;
+				slave.skill.anal = 35;
+				slave.skill.whoring = 35;
+				slave.skill.entertainment = 35;
+				slave.skill.combat = 0;
+				slave.clitPiercing = 1;
+				slave.earPiercing = 1;
+				slave.behavioralFlaw = "arrogant";
+				slave.behavioralQuirk = "insecure";
+				slave.sexualFlaw = "crude";
+				slave.sexualQuirk = "caring";
+				slave.hStyle = "tails";
+				slave.hLength = 80;
+				break;
+			default:
+				slave = GenerateNewSlave("XX", {
+					minAge: 18, maxAge: 42, race: race, disableDisability: 1
+				});
+				slave.face = 100;
+				slave.faceImplant = 15;
+				slave.muscles = 0;
+				slave.lips = 35;
+				slave.butt += random(1, 3);
+				slave.boobs += 200 * random(1, 3);
+				slave.anus = 4;
+				slave.vagina = 4;
+				if (V.seePreg === 1) {
+					slave.preg = 2;
+					slave.pregKnown = 1;
+					slave.pregWeek = slave.preg;
+					slave.pregType = setPregType(slave);
+					SetBellySize(slave);
+				}
+				slave.skill.vaginal = 100;
+				slave.skill.oral = 100;
+				slave.skill.anal = 100;
+				slave.skill.whoring = 100;
+				slave.skill.entertainment = 0;
+				slave.skill.combat = 0;
+				slave.clitPiercing = 1;
+				slave.earPiercing = 1;
+				slave.behavioralFlaw = "bitchy";
+				slave.behavioralQuirk = "funny";
+				slave.sexualFlaw = "crude";
+				slave.sexualQuirk = "size queen";
+				slave.hStyle = "neat";
+				slave.hLength = 80;
+				slave.addict = 10;
+		}
+		slave.intelligence = 100;
+		slave.intelligenceImplant = 30;
+		slave.devotion = -20;
+		slave.trust = -10;
+		slave.origin = "${He} was once an arcology owner like yourself.";
+		slave.career = "an arcology owner";
+		slave.prestige = 3;
+		slave.prestigeDesc = "You bankrupted and enslaved ${him} in revenge for ${his} part in the attack on your arcology by the Daughters of Liberty.";
+		setHealth(slave, 100, 0, 0, 0, jsRandom(10, 30));
+		if (slave.physicalAge > 35) {
+			applyAgeImplant(slave);
+		}
+		slave.pubicHStyle = "waxed";
+		slave.underArmHStyle = "waxed";
+		return slave;
+	}
+};
diff --git a/src/uncategorized/pRivalryCapture.tw b/src/uncategorized/pRivalryCapture.tw
deleted file mode 100644
index 9490863e8b9622efb4de03e1bc099b14489b1d90..0000000000000000000000000000000000000000
--- a/src/uncategorized/pRivalryCapture.tw
+++ /dev/null
@@ -1,450 +0,0 @@
-:: P rivalry capture [nobr]
-
-<<set $rivalOwner = -1>>
-<<set _rivalType = []>>
-<<if $rivalGender == 2>>
-	<<set _rivalType.push("expansionist shemale")>>
-	<<set _rivalType.push("masculine")>>
-	<<set _rivalType.push("micropenis")>>
-	<<set _rivalType.push("cum addict")>>
-	<<if $pedo_mode == 1>>
-		<<set _rivalType.push("hung shota")>>
-	<</if>>
-<<else>>
-	<<set _rivalType.push("bull dyke")>>
-	<<set _rivalType.push("cow")>>
-	<<set _rivalType.push("bimbo")>>
-	<<set _rivalType.push("addict")>>
-	<<if $seePreg == 1>>
-		<<set _rivalType.push("breeder")>>
-	<</if>>
-	<<if $pedo_mode == 1>>
-		<<set _rivalType.push("oppai loli")>>
-	<</if>>
-<</if>>
-<<set _rivalType = _rivalType.random()>>
-
-<<if setup.filterRacesLowercase.includes($rivalRace)>>
-	<<set _race = $rivalRace>>
-<</if>>
-<<switch _rivalType>>
-<<case "expansionist shemale">>
-	<<set $activeSlave = GenerateNewSlave("XY", {minAge: 18, maxAge: 42, race: _race, disableDisability: 1})>>
-	<<set $activeSlave.face = 100>>
-	<<set $activeSlave.faceImplant = 15>>
-	<<set $activeSlave.faceShape = "androgynous">>
-	<<set $activeSlave.muscles = 20>>
-	<<set $activeSlave.height = random(185,215)>>
-	<<set $activeSlave.lips = 35>>
-	<<set $activeSlave.butt = either(4, 5, 6)>>
-	<<set $activeSlave.boobs = either(800, 1000, 1200)>>
-	<<set $activeSlave.dick = 6>>
-	<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
-	<<set $activeSlave.balls = 10>>
-	<<set $activeSlave.anus = 3>>
-	<<set $activeSlave.vagina = -1>>
-	<<set $activeSlave.weight = 20>>
-	<<set $activeSlave.skill.oral = 100>>
-	<<set $activeSlave.skill.anal = 100>>
-	<<set $activeSlave.skill.whoring = 15>>
-	<<set $activeSlave.skill.entertainment = 100>>
-	<<set $activeSlave.skill.combat = 0>>
-	<<set $activeSlave.clitPiercing = 2>>
-	<<set $activeSlave.nipplesPiercing = 1>>
-	<<set $activeSlave.earPiercing = 1>>
-	<<set $activeSlave.tonguePiercing = 1>>
-	<<set $activeSlave.eyebrowPiercing = 1>>
-	<<set $activeSlave.behavioralFlaw = "odd">>
-	<<set $activeSlave.behavioralQuirk = "confident">>
-	<<set $activeSlave.sexualFlaw = "judgemental">>
-	<<set $activeSlave.sexualQuirk = "romantic">>
-	<<set $activeSlave.hStyle = "luxurious">>
-	<<set $activeSlave.hLength = 80>>
-<<case "cum addict">>
-	<<set $activeSlave = GenerateNewSlave("XY", {minAge: 18, maxAge: 42, race: _race, disableDisability: 1})>>
-	<<set $activeSlave.chem = 3000>>
-	<<set $activeSlave.face = 100>>
-	<<set $activeSlave.faceShape = "masculine">>
-	<<set $activeSlave.muscles = 100>>
-	<<set $activeSlave.height = random(185,215)>>
-	<<set $activeSlave.lips = 10>>
-	<<set $activeSlave.butt = 10>>
-	<<set $activeSlave.boobs = either(100, 200)>>
-	<<set $activeSlave.dick = 6>>
-	<<set $activeSlave.foreskin = 0>>
-	<<set $activeSlave.balls = 300>>
-	<<set $activeSlave.scrotum = 280>>
-	<<set $activeSlave.anus = 3>>
-	<<set $activeSlave.vagina = -1>>
-	<<set $activeSlave.weight = -35>>
-	<<set $activeSlave.skill.oral = 0>>
-	<<set $activeSlave.skill.anal = 100>>
-	<<set $activeSlave.skill.whoring = 15>>
-	<<set $activeSlave.skill.entertainment = 100>>
-	<<set $activeSlave.skill.combat = 0>>
-	<<set $activeSlave.dickPiercing = 2>>
-	<<set $activeSlave.fetish = "pregnancy">>
-	<<set $activeSlave.fetishStrength = 100>>
-	<<set $activeSlave.behavioralFlaw = "odd">>
-	<<set $activeSlave.behavioralQuirk = "confident">>
-	<<set $activeSlave.sexualFlaw = "cum addict">>
-	<<set $activeSlave.sexualQuirk = "size queen">>
-	<<set $activeSlave.hStyle = "neat">>
-	<<set $activeSlave.hLength = 20>>
-<<case "hung shota">>
-	<<set $activeSlave = GenerateNewSlave("XY", {minAge: $minimumSlaveAge, maxAge: 42, race: _race, disableDisability: 1})>>
-	<<set $activeSlave.face = 100>>
-	<<set $activeSlave.faceShape = "androgynous">>
-	<<set $activeSlave.muscles = 0>>
-	<<set $activeSlave.lips = 10>>
-	<<set $activeSlave.butt = 0>>
-	<<set $activeSlave.boobs = either(100, 200)>>
-	<<set $activeSlave.dick = 6>>
-	<<set $activeSlave.foreskin = $activeSlave.dick>>
-	<<set $activeSlave.balls = 6>>
-	<<set $activeSlave.scrotum = 6>>
-	<<set $activeSlave.anus = 0>>
-	<<set $activeSlave.vagina = -1>>
-	<<set $activeSlave.weight = -35>>
-	<<set $activeSlave.skill.oral = 0>>
-	<<set $activeSlave.skill.anal = 0>>
-	<<set $activeSlave.skill.whoring = 0>>
-	<<set $activeSlave.skill.entertainment = 100>>
-	<<set $activeSlave.skill.combat = 0>>
-	<<set $activeSlave.dickPiercing = 2>>
-	<<set $activeSlave.pubertyXY = 1>>
-	<<set $activeSlave.fetish = "pregnancy">>
-	<<set $activeSlave.fetishStrength = 100>>
-	<<set $activeSlave.behavioralFlaw = "hates men">>
-	<<set $activeSlave.behavioralQuirk = "adores women">>
-	<<set $activeSlave.sexualFlaw = "shamefast">>
-	<<set $activeSlave.sexualQuirk = "perverted">>
-	<<set $activeSlave.hLength = 20>>
-<<case "masculine">>
-	<<set $activeSlave = GenerateNewSlave("XY", {minAge: 18, maxAge: 42, race: _race, disableDisability: 1})>>
-	<<set $activeSlave.face = 55>>
-	<<set $activeSlave.faceImplant = 0>>
-	<<set $activeSlave.faceShape = "masculine">>
-	<<set $activeSlave.muscles = either(20, 50, 100)>>
-	<<set $activeSlave.height = random(185,195)>>
-	<<set $activeSlave.butt = either(2, 3)>>
-	<<set $activeSlave.boobs = either(100, 200)>>
-	<<set $activeSlave.dick = 5>>
-	<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
-	<<set $activeSlave.balls = 5>>
-	<<set $activeSlave.anus = 0>>
-	<<set $activeSlave.vagina = -1>>
-	<<set $activeSlave.weight = 0>>
-	<<set $activeSlave.skill.vaginal = 0>>
-	<<set $activeSlave.skill.oral = 15>>
-	<<set $activeSlave.skill.anal = 0>>
-	<<set $activeSlave.skill.whoring = 0>>
-	<<set $activeSlave.skill.entertainment = 15>>
-	<<set $activeSlave.skill.combat = 1>>
-	<<set $activeSlave.behavioralFlaw = "hates men">>
-	<<set $activeSlave.behavioralQuirk = "fitness">>
-	<<set $activeSlave.sexualFlaw = "hates anal">>
-	<<set $activeSlave.sexualQuirk = "perverted">>
-	<<set $activeSlave.hStyle = "neat">>
-	<<set $activeSlave.hLength = 5>>
-<<case "micropenis">>
-	<<set $activeSlave = GenerateNewSlave("XY", {minAge: 18, maxAge: 42, race: _race, disableDisability: 1})>>
-	<<set $activeSlave.face = 55>>
-	<<set $activeSlave.faceImplant = 0>>
-	<<set $activeSlave.faceShape = "masculine">>
-	<<set $activeSlave.muscles = 0>>
-	<<set $activeSlave.height = random(145,160)>>
-	<<set $activeSlave.butt = either(2, 4)>>
-	<<set $activeSlave.boobs = either(100, 400)>>
-	<<set $activeSlave.dick = 1>>
-	<<if $activeSlave.foreskin > 0>><<set $activeSlave.foreskin = $activeSlave.dick>><</if>>
-	<<set $activeSlave.balls = 2>>
-	<<set $activeSlave.anus = 1>>
-	<<set $activeSlave.vagina = -1>>
-	<<set $activeSlave.weight = 100>>
-	<<set $activeSlave.skill.vaginal = 0>>
-	<<set $activeSlave.skill.oral = 15>>
-	<<set $activeSlave.skill.anal = 15>>
-	<<set $activeSlave.skill.whoring = 0>>
-	<<set $activeSlave.skill.entertainment = 15>>
-	<<set $activeSlave.skill.combat = 0>>
-	<<set $activeSlave.behavioralFlaw = "hates men">>
-	<<set $activeSlave.behavioralQuirk = "insecure">>
-	<<set $activeSlave.sexualFlaw = "shamefast">>
-	<<set $activeSlave.sexualQuirk = "perverted">>
-	<<set $activeSlave.hStyle = "neat">>
-	<<set $activeSlave.hLength = 5>>
-<<case "bull dyke">>
-	<<set $activeSlave = GenerateNewSlave("XX", {minAge: 18, maxAge: 42, race: _race, disableDisability: 1})>>
-	<<set $activeSlave.face = 55>>
-	<<set $activeSlave.faceImplant = 0>>
-	<<set $activeSlave.faceShape = "androgynous">>
-	<<set $activeSlave.muscles = 100>>
-	<<set $activeSlave.height = random(185,195)>>
-	<<set $activeSlave.lipsImplant = 10>>
-	<<set $activeSlave.lips = 35>>
-	<<set $activeSlave.buttImplant = 1>>
-	<<set $activeSlave.butt += $activeSlave.buttImplant>>
-	<<set $activeSlave.buttImplantType = "normal">>
-	<<set $activeSlave.boobs -= 100>>
-	<<set $activeSlave.boobsImplant = either(400, 600, 800)>>
-	<<set $activeSlave.boobs += $activeSlave.boobsImplant>>
-	<<set $activeSlave.boobsImplantType = "normal">>
-	<<set $activeSlave.clit = 2>>
-	<<set $activeSlave.anus = 1>>
-	<<set $activeSlave.vagina = 1>>
-	<<set $activeSlave.preg = -1>>
-	<<set $activeSlave.skill.vaginal = 15>>
-	<<set $activeSlave.skill.oral = 0>>
-	<<set $activeSlave.skill.anal = 15>>
-	<<set $activeSlave.skill.whoring = 0>>
-	<<set $activeSlave.skill.entertainment = 0>>
-	<<set $activeSlave.skill.combat = 1>>
-	<<set $activeSlave.clitPiercing = 1>>
-	<<set $activeSlave.earPiercing = 1>>
-	<<set $activeSlave.behavioralFlaw = "hates men">>
-	<<set $activeSlave.behavioralQuirk = "fitness">>
-	<<set $activeSlave.sexualFlaw = "hates penetration">>
-	<<set $activeSlave.sexualQuirk = "unflinching">>
-	<<set $activeSlave.hStyle = "neat">>
-	<<set $activeSlave.hLength = 5>>
-<<case "breeder">>
-	<<if $pedo_mode == 1>>
-		<<set _minAge = ($fertilityAge + 6)>>
-		<<set _pedo = 1>> /* Old enough to have been pregnant many times. */
-	<<else>>
-		<<set _minAge = 18>>
-		<<set _maxAge = 42>>
-	<</if>>
-	<<set $activeSlave = GenerateNewSlave("XX", {minAge: _minAge, maxAge: _maxAge, ageOverridesPedoMode: _pedo, race: _race, disableDisability: 1})>>
-	<<set $activeSlave.pubertyXX = 1>>
-	<<set $activeSlave.face = 100>>
-	<<set $activeSlave.faceImplant = 0>>
-	<<set $activeSlave.faceShape = "sensual">>
-	<<set $activeSlave.muscles = 50>>
-	<<set $activeSlave.lips = 35>>
-	<<set $activeSlave.butt = either(6, 7, 8)>>
-	<<set $activeSlave.boobs = 5000>>
-	<<set $activeSlave.nipples = "huge">>
-	<<set $activeSlave.lactation = 1>>
-	<<set $activeSlave.lactationDuration = 2>>
-	<<set $activeSlave.anus = 1>>
-	<<set $activeSlave.preg = 25>>
-	<<if $seeHyperPreg == 1>>
-		<<set $activeSlave.geneticQuirks.uterineHypersensitivity = 2>>
-		<<set $activeSlave.vagina = 10>>
-		<<set $activeSlave.pregType = random(20,35)>>
-		<<set $activeSlave.counter.birthsTotal = random(120,180)>>
-		<<set $activeSlave.bellySag = 30, $activeSlave.bellySagPreg = 30>>
-		<<set $activeSlave.pregAdaptation = $activeSlave.counter.birthsTotal*2>>
-	<<else>>
-		<<set _UHSchance = Math.random()>>
-		<<if _UHSchance > 0.9>>
-			<<set $activeSlave.geneticQuirks.uterineHypersensitivity = 2>>
-		<<elseif _UHSchance > 0.6 && $activeSlave.geneticQuirks.uterineHypersensitivity != 2>>
-			<<set $activeSlave.geneticQuirks.uterineHypersensitivity = 1>>
-		<</if>>
-		<<set $activeSlave.vagina = 5>>
-		<<set $activeSlave.pregType = either(3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8)>>
-		<<set $activeSlave.counter.birthsTotal = random(18,27)>>
-		<<set $activeSlave.bellySag = 2, $activeSlave.bellySagPreg = 2>>
-		<<set $activeSlave.pregAdaptation = (random(60,100) + ($activeSlave.counter.birthsTotal * $activeSlave.geneticQuirks.uterineHypersensitivity))>>
-	<</if>>
-	<<set $activeSlave.pregKnown = 1>>
-	<<set $activeSlave.pregWeek = $activeSlave.preg>>
-	<<run SetBellySize($activeSlave)>>
-	<<set $activeSlave.skill.vaginal = 100>>
-	<<set $activeSlave.skill.oral = 15>>
-	<<set $activeSlave.skill.anal = 15>>
-	<<set $activeSlave.skill.whoring = 35>>
-	<<set $activeSlave.skill.entertainment = 15>>
-	<<set $activeSlave.skill.combat = 0>>
-	<<set $activeSlave.fetish = "pregnancy">>
-	<<set $activeSlave.fetishStrength = 1000>>
-	<<set $activeSlave.behavioralFlaw = "odd">>
-	<<set $activeSlave.behavioralQuirk = "adores men">>
-	<<set $activeSlave.sexualFlaw = "breeder">>
-	<<set $activeSlave.sexualQuirk = "caring">>
-	<<set $activeSlave.hStyle = "luxurious">>
-	<<set $activeSlave.hLength = 80>>
-<<case "oppai loli">>
-	<<set $activeSlave = GenerateNewSlave("XX", {minAge: $minimumSlaveAge, maxAge: 12, race: _race, disableDisability: 1})>>
-	<<set $activeSlave.face = 100>>
-	<<set $activeSlave.faceImplant = 0>>
-	<<set $activeSlave.faceShape = "cute">>
-	<<set $activeSlave.muscles = 20>>
-	<<set $activeSlave.weight = 60>>
-	<<set $activeSlave.lips = 10>>
-	<<set $activeSlave.butt = 1>>
-	<<set $activeSlave.hips = -1>>
-	<<set $activeSlave.shoulders = -2>>
-	<<set $activeSlave.boobs = 7000>>
-	<<set $activeSlave.nipples = "huge">>
-	<<set $activeSlave.anus = 0>>
-	<<set $activeSlave.vagina = 0>>
-	<<set $activeSlave.preg = 0>>
-	<<set $activeSlave.skill.vaginal = 0>>
-	<<set $activeSlave.skill.oral = 0>>
-	<<set $activeSlave.skill.anal = 0>>
-	<<set $activeSlave.skill.whoring = 0>>
-	<<set $activeSlave.skill.entertainment = 15>>
-	<<set $activeSlave.skill.combat = 0>>
-	<<set $activeSlave.behavioralFlaw = "odd">>
-	<<set $activeSlave.behavioralQuirk = "insecure">>
-	<<set $activeSlave.sexualFlaw = "shamefast">>
-	<<set $activeSlave.sexualQuirk = "tease">>
-	<<set $activeSlave.hStyle = "twin tails">>
-	<<set $activeSlave.hLength = 40>>
-<<case "cow">>
-	<<set $activeSlave = GenerateNewSlave("XX", {minAge: 18, maxAge: 42, race: _race, disableDisability: 1})>>
-	<<set $activeSlave.face = 55>>
-	<<set $activeSlave.faceImplant = 0>>
-	<<set $activeSlave.faceShape = "cute">>
-	<<set $activeSlave.muscles = 50>>
-	<<set $activeSlave.height = random(185,195)>>
-	<<set $activeSlave.lips = 35>>
-	<<set $activeSlave.butt = either(6, 7, 8)>>
-	<<set $activeSlave.boobs = 30000>>
-	<<set $activeSlave.weight = random(100,160)>>
-	<<set $activeSlave.nipples = "huge">>
-	<<set $activeSlave.lactation = 2>>
-	<<set $activeSlave.lactationDuration = 2>>
-	<<set $activeSlave.anus = 1>>
-	<<set $activeSlave.vagina = 2>>
-	<<set $activeSlave.preg = 0>>
-	<<set $activeSlave.skill.vaginal = 15>>
-	<<set $activeSlave.skill.oral = 15>>
-	<<set $activeSlave.skill.anal = 0>>
-	<<set $activeSlave.skill.whoring = 0>>
-	<<set $activeSlave.skill.entertainment = 15>>
-	<<set $activeSlave.skill.combat = 0>>
-	<<set $activeSlave.behavioralFlaw = "odd">>
-	<<set $activeSlave.behavioralQuirk = "insecure">>
-	<<set $activeSlave.sexualFlaw = "breast growth">>
-	<<set $activeSlave.sexualQuirk = "perverted">>
-	<<set $activeSlave.hStyle = "neat">>
-	<<set $activeSlave.hLength = 5>>
-<<case "bimbo">>
-	<<set $activeSlave = GenerateNewSlave("XX", {minAge: 18, maxAge: 42, race: _race, disableDisability: 1})>>
-	<<set $activeSlave.face = 100>>
-	<<set $activeSlave.faceImplant = 65>>
-	<<set $activeSlave.faceShape = "sensual">>
-	<<set $activeSlave.muscles = 0>>
-	<<set $activeSlave.height = random(180,190)>>
-	<<set $activeSlave.lipsImplant = 2>>
-	<<set $activeSlave.lips = random(25,55)>>
-	<<set $activeSlave.buttImplant = 2>>
-	<<set $activeSlave.butt += $activeSlave.buttImplant>>
-	<<set $activeSlave.buttImplantType = "normal">>
-	<<set $activeSlave.boobsImplant = either(600, 800, 1000)>>
-	<<set $activeSlave.boobs += $activeSlave.boobsImplant>>
-	<<set $activeSlave.boobsImplantType = "normal">>
-	<<set $activeSlave.anus = 2>>
-	<<set $activeSlave.vagina = 1>>
-	<<set $activeSlave.preg = -1>>
-	<<set $activeSlave.skill.vaginal = 100>>
-	<<set $activeSlave.skill.oral = 100>>
-	<<set $activeSlave.skill.anal = 35>>
-	<<set $activeSlave.skill.whoring = 35>>
-	<<set $activeSlave.skill.entertainment = 35>>
-	<<set $activeSlave.skill.combat = 0>>
-	<<set $activeSlave.clitPiercing = 1>>
-	<<set $activeSlave.earPiercing = 1>>
-	<<set $activeSlave.behavioralFlaw = "arrogant">>
-	<<set $activeSlave.behavioralQuirk = "insecure">>
-	<<set $activeSlave.sexualFlaw = "crude">>
-	<<set $activeSlave.sexualQuirk = "caring">>
-	<<set $activeSlave.hStyle = "tails">>
-	<<set $activeSlave.hLength = 80>>
-<<default>>
-	<<set $activeSlave = GenerateNewSlave("XX", {minAge: 18, maxAge: 42, race: _race, disableDisability: 1})>>
-	<<set $activeSlave.face = 100>>
-	<<set $activeSlave.faceImplant = 15>>
-	<<set $activeSlave.muscles = 0>>
-	<<set $activeSlave.lips = 35>>
-	<<set $activeSlave.butt += random(1,3)>>
-	<<set $activeSlave.boobs += 200*random(1,3)>>
-	<<set $activeSlave.anus = 4>>
-	<<set $activeSlave.vagina = 4>>
-	<<if $seePreg == 1>>
-		<<set $activeSlave.preg = 2>>
-		<<set $activeSlave.pregKnown = 1>>
-		<<set $activeSlave.pregWeek = $activeSlave.preg>>
-		<<set $activeSlave.pregType = setPregType($activeSlave)>>
-		<<run SetBellySize($activeSlave)>>
-	<</if>>
-	<<set $activeSlave.skill.vaginal = 100>>
-	<<set $activeSlave.skill.oral = 100>>
-	<<set $activeSlave.skill.anal = 100>>
-	<<set $activeSlave.skill.whoring = 100>>
-	<<set $activeSlave.skill.entertainment = 0>>
-	<<set $activeSlave.skill.combat = 0>>
-	<<set $activeSlave.clitPiercing = 1>>
-	<<set $activeSlave.earPiercing = 1>>
-	<<set $activeSlave.behavioralFlaw = "bitchy">>
-	<<set $activeSlave.behavioralQuirk = "funny">>
-	<<set $activeSlave.sexualFlaw = "crude">>
-	<<set $activeSlave.sexualQuirk = "size queen">>
-	<<set $activeSlave.hStyle = "neat">>
-	<<set $activeSlave.hLength = 80>>
-	<<set $activeSlave.addict = 10>>
-<</switch>>
-<<set $activeSlave.intelligence = 100>>
-<<set $activeSlave.intelligenceImplant = 30>>
-<<set $activeSlave.devotion = -20>>
-<<set $activeSlave.trust = -10>>
-<<set $activeSlave.origin = "$He was once an arcology owner like yourself.">>
-<<set $activeSlave.career = "an arcology owner">>
-<<set $activeSlave.prestige = 3>>
-<<set $activeSlave.prestigeDesc = "You bankrupted and enslaved $him in revenge for $his part in the attack on your arcology by the Daughters of Liberty.">>
-<<run setHealth($activeSlave, 100, 0, 0, 0, jsRandom(10, 30))>>
-<<if $activeSlave.physicalAge > 35>><<run applyAgeImplant($activeSlave)>><</if>>
-<<set $activeSlave.pubicHStyle = "waxed">>
-<<set $activeSlave.underArmHStyle = "waxed">>
-
-<<setLocalPronouns $activeSlave>>
-
-<<if $seeImages == 1>>
-	<<if $imageChoice == 1>>
-		<div class="imageRef medImg"><<= SlaveArt($activeSlave, 2, 0)>></div>
-	<<else>>
-		<div class="imageRef medImg"><<= SlaveArt($activeSlave, 2, 0)>></div>
-	<</if>>
-<</if>>
-
-Your
-<<if passage() == "P rivalry actions">>
-	target is quickly delivered. Politely dismissing the head of your $mercenariesTitle, you savor
-<<else>>
-	bounty is quickly claimed, and you are treated to
-<</if>>
-the delicious moment of finding your rival on <<if hasBothLegs($activeSlave)>>$his knees<<else>>the ground<</if>> in front of you with a black bag over $his head and $his hands cuffed behind $him. $He's one of your slaves now, fundamentally no different than any other. Looking $him over, the causes of $his downfall are
-<<switch _rivalType>>
-<<case "expansionist shemale">>
-	immediately apparent: $he's obviously been indulging in self-transformation to excess.
-<<case "cum addict">>
-	immediately apparent: there's nothing wrong with having cumflation and ball expansion fetishes, but applying them to oneself can be addictive.
-<<case "hung shota">>
-	not immediately apparent: $he's young, in good shape, and not lacking down there at all.
-<<case "masculine">>
-	not immediately apparent: $he's in good shape, if quite masculine.
-<<case "micropenis">>
-	immediately apparent: $he's got a slavegirl's cock and balls, not an arcology owner's.
-<<case "bull dyke">>
-	not immediately apparent: though female, $he's obviously no stranger to taking a dominant sexual role, to put it politely.
-<<case "breeder">>
-	immediately apparent: there's nothing wrong with having a pregnancy fetish, but applying it to oneself is ill-fitting for an arcology owner.
-<<case "oppai loli">>
-	immediately apparent: $he's young, inexperienced, and extremely top heavy.
-<<case "cow">>
-	immediately apparent: there's nothing wrong with having lactation and breast expansion fetishes, but applying them to oneself can be addictive.
-<<case "bimbo">>
-	immediately apparent: there's nothing wrong with having a bimbo fetish, but applying it to oneself can be addictive.
-<<default>>
-	immediately apparent: $he seems to have recently fallen into serious aphrodisiac addiction.
-<</switch>>
-
-<<set $nextLink = "AS Dump", $returnTo = "P rival initiation", $rivalID = $activeSlave.ID>> /* proceed directly to rival initiation event after New Slave Intro */
-<<set $rivalRace = 0>>
-<<set $rivalGender = 0>>
-<<include "New Slave Intro">>
diff --git a/src/uncategorized/pRivalryVictory.tw b/src/uncategorized/pRivalryVictory.tw
index 81801ded0d298128110e4a0b8bac40a06314a6f4..8b60f4351fb20985551df283f16795f52be1399c 100644
--- a/src/uncategorized/pRivalryVictory.tw
+++ b/src/uncategorized/pRivalryVictory.tw
@@ -144,7 +144,7 @@ For the first time, you receive a direct call from your rival. You pictured the
 		<<run cashX(random(-10000,-25000), "war")>>
 	<</if>>
 	<<run cashX(-50000, "war")>>
-	<<include "P rivalry capture">>
+	<<includeDOM pRivalryCapture()>>
 	<</replace>>
 <</link>>
 </span>
diff --git a/src/uncategorized/reFSEgyptianRevivalistAcquisition.tw b/src/uncategorized/reFSEgyptianRevivalistAcquisition.tw
index b13df215d74c715b69b23bceea735afd08e4889d..21f03484a15aae29eaf841c716c3c17802c55ac4 100644
--- a/src/uncategorized/reFSEgyptianRevivalistAcquisition.tw
+++ b/src/uncategorized/reFSEgyptianRevivalistAcquisition.tw
@@ -3,7 +3,7 @@
 /* Written and coded by Boney M */
 <<set $nextButton = "Continue", $nextLink = "RIE Eligibility Check", $returnTo = "RIE Eligibility Check">>
 <<set $encyclopedia = "Enslaving People">>
-<<set $introType = "egyptian", $newSlavesDone = 0, $newSlaveIndex = 0, _newSlaves = []>>
+<<set $market = {introType: "egyptian", newSlavesDone: 0, newSlaveIndex: 0}, _newSlaves = []>>
 
 <<set _contractCost = 3000>>
 <<set $activeSlave = GenerateNewSlave(null, {minAge: Math.max(16, $minimumSlaveAge + 3), maxAge: 29, disableDisability: 1})>>
@@ -70,7 +70,7 @@ This call is coming from a public kiosk, which is usually an indication that the
 <br><br>
 <span id="result">
 <<if $cash >= _contractCost>>
-	[[Enslave the pair|Bulk Slave Intro][$newSlaves = _newSlaves, $newSlaves.forEach((s) => cashX(forceNeg(_contractCost/$newSlaves.length), "slaveTransfer", s))]]
+	[[Enslave the pair|Bulk Slave Intro][$market = {newSlaves: _newSlaves}, $market.newSlaves.forEach((s) => cashX(forceNeg(_contractCost/$market.newSlaves.length), "slaveTransfer", s))]]
 <<else>>
 	//You lack the necessary funds to enslave them.//
 <</if>>