diff --git a/src/gui/Encyclopedia/encyclopedia.tw b/src/gui/Encyclopedia/encyclopedia.tw
index 20343fd534947f5dbc21e9be179d250dfbcc03a6..4818bd970a532ec3c6376a9d040fc2c05772c474 100644
--- a/src/gui/Encyclopedia/encyclopedia.tw
+++ b/src/gui/Encyclopedia/encyclopedia.tw
@@ -937,8 +937,9 @@ __I do not give credit without explicit permission to do so.__ If you have contr
 ''anon'' for forcing dicks into slavegirls and forced slave riding.
 ''Unknown modder'' who did betterRA mod for old 0.9.5.4 version of original FC.
 ''brpregmodfan'' for Brazilian start and slave gen.
-''fcanon'' for various fixes and wrangling my inabilty to spll gud.
-''stuffedgameanon'' for fixes, streamlining the starting girls family code and family trees (I think).
+''fcanon'' for various fixes, massive improvements to the RA and wrangling my inabilty to spll gud.
+''stuffedgameanon'' for fixes, streamlining the starting girls family code, family trees, unbelievable improvements to the games functionality, the sanityChecker, a tag checker and above ALL else; Improving the game's speed by an obscene amount.
+''anon'' for a prototype foot job scene.
 ''Bane70'' optimized huge swaths of code with notable professionalism.
 ''Circle Tritagonist'' provided several new collars and outfits.
 ''Qotsafan'' submitted bugfixes.
diff --git a/src/gui/css/mainStyleSheet.tw b/src/gui/css/mainStyleSheet.tw
index 0a80f4dd286e725f1689ae66d48a510cb350a79a..54844d92acbf0e00a4d5da8390e772d452d5606d 100644
--- a/src/gui/css/mainStyleSheet.tw
+++ b/src/gui/css/mainStyleSheet.tw
@@ -6,6 +6,11 @@
     -webkit-transition: none;
 }
 
+.passage-in {
+    opacity: 1 !important;
+}
+
+
 /* default is 54em */
 #passages {
     max-width: 90%;
diff --git a/src/js/storyJS.tw b/src/js/storyJS.tw
index 6983f1e2eb696b591706b87bec6da5b6d92c6f62..0256fce795701f1822d34a276af3988c21cb3a9c 100644
--- a/src/js/storyJS.tw
+++ b/src/js/storyJS.tw
@@ -775,7 +775,7 @@ window.ruleApplied = function(slave, ID) {
 
 window.ruleAssignment = function(applyAssignment, assignment) {
 	if (!applyAssignment) {
-		return true;
+		return false;
 	}
 	for(var d=0; d < applyAssignment.length; ++d){
 		if(applyAssignment[d] == assignment){
@@ -896,7 +896,7 @@ window.ruleAppliedToSlaveFacility = function(rule, slave) {
 	}else if (!rule) {
 		return null;
 	}else if (!rule.facility) {
-		return true;
+		return false;
 	} else {
 		for(var d = 0; d < rule.facility.length; ++d){
 			if(rule.facility[d] == "hgsuite"){
diff --git a/src/pregmod/widgets/pregmodWidgets.tw b/src/pregmod/widgets/pregmodWidgets.tw
index 8fbaf3f62db1b56c5295c95370b8a61e5b19250a..f453256fe8266a122a7eee0ca922a398880a11c3 100644
--- a/src/pregmod/widgets/pregmodWidgets.tw
+++ b/src/pregmod/widgets/pregmodWidgets.tw
@@ -937,7 +937,7 @@ $activeSlave.slaveName is up for review:
 		<br>She @@.red;EXCEEDED@@ weight mimits.
 		<<set $passing-->>
 	<</if>>
-	<<if $activeSlave.butt  <= $activeStandard.butt>>
+	<<if $activeSlave.butt <= $activeStandard.butt>>
 		<br>She @@.lime;MET@@ ass measurements.
 	<<else>>
 		<br>She @@.red;EXCEEDED@@ ass measurements.
diff --git a/src/uncategorized/clinic.tw b/src/uncategorized/clinic.tw
index 54605b5d3009dfb615673771e105cf8bedcbabc1..a5fd4ba0be952262893465f2d2559ea1982c8341 100644
--- a/src/uncategorized/clinic.tw
+++ b/src/uncategorized/clinic.tw
@@ -107,7 +107,7 @@ $clinicNameCaps
 <<if $pregSpeedControl == 1 && $Nurse == 0>>
 	A resident nurse could be used to supervise patients under rapid gestation agents while minimizing strain and health complications.
 <<elseif $pregSpeedControl == 1 && $clinicSpeedGestation == 1>>
-	It's exceedingly dangerous to speed up gestation without constant supervision. In $clinicName, $Nurse.slaveName will monitor slaves on rapid gestation agents; making sure the growing patients' food demands are met, monitoring their skin and womb and, if need be, perform an emergency c-section should the need arise. [[Limit rapid gestation agents to slected slaves only|Clinic][$clinicSpeedGestation = 0]]
+	It's exceedingly dangerous to speed up gestation without constant supervision. In $clinicName, $Nurse.slaveName will monitor slaves on rapid gestation agents; making sure the growing patients' food demands are met, monitoring their skin and womb and, if need be, perform an emergency c-section should the need arise. [[Limit rapid gestation agents to selected slaves only|Clinic][$clinicSpeedGestation = 0]]
 <<elseif $pregSpeedControl == 1 && $Nurse != 0 && $clinicSpeedGestation != 1>>
 	$clinicNameCaps is currently not applying rapid gestation agents to pregnant patients. Only individually selected slaves will undergo this procedure [[Speed up gestation for all pregnant patients|Clinic][$clinicSpeedGestation = 1]]
 <</if>>
diff --git a/src/uncategorized/personalAssistantAppearance.tw b/src/uncategorized/personalAssistantAppearance.tw
index 37b5a711db13f2143039de362e8a71a874ed138c..69cbce57a6b4acad41aa5ae12024e7f336857812 100644
--- a/src/uncategorized/personalAssistantAppearance.tw
+++ b/src/uncategorized/personalAssistantAppearance.tw
@@ -1203,19 +1203,19 @@ She's a cute little <<if $arcologies[0].FSSupremacist != "unset">>$arcologies[0]
 		She frequently carries a tome of new and erotic spells.
 	<</if>>
 <<if ($cockFeeder == 1) && ($seed == 1)>>
-	She is steadily forcing a dildo the size of your arm down representation of one of your slave's throat. The slave must be down in the kitchen, getting a meal out of the food dispensers. The imp notices you watching, points to the obscene bulge in the slave's throat and laughs maniacally.
+	She is steadily conjuring cake slices out of thin air and sending them down a representation of one of your slave's throat as her belly swells. The slave must be down in the kitchen, getting a meal out of the food dispensers. The witch notices you watching, creates a whole cake, and send it on its way causing the slave's gut to double in size.
 <<elseif ($suppository == 1) && ($seed == 2)>>
-	A recognizable little representation of one of your slaves is before her, ass in the air, as she enthusiastically winds an anal pear. The slave must be receiving her drugs from one of the dildo dispensers. The imp notices you watching and laughs as she gapes the slave's asshole further, enjoying her obvious discomfort.
+	A recognizable little representation of one of your slaves is before her, writhing in pleasure, as a summoned tentacle explores her anus. The slave must be receiving her drugs from one of the dildo dispensers. The witch notices you watching and pats her own squirming belly, causing the tentacle to seek shelter deeper in the slave.
 <<elseif ($masturbationAllowed == 1) && ($seed == 3)>>
-	A recognizable little representation of one of your slaves is before her, perched atop a wooden horse with sexual fluids running down its sides. The slave must be using one of the penthouse's many sex toys. Noticing you watching, the imp flys above her and roughly forces her down, eliciting a scream of surprise from the horny slave. She likly upped the output on whatever toy the slave was using.
+	A recognizable little representation of one of your slaves is squatting atop a magic circle before her, a dildo pistoning in and out of her. The slave must be using one of the penthouse's many sex toys. Noticing you watching, the witch snaps her fingers causing the toy to blow a load deep inside the slave. A load moan echos down the halls of your penthouse, someone must be having a good time.
 <<elseif ($seed == 4)>>
-	A recognizable little representation of one of your slaves is lying on her side before her; belly painfully distended. The imp is hovering over her holding an enema bag; the slave must be getting a checkup. She notices your gaze and squeezes the bag, forcing a burst of liquid into the slave's gut and drawing a moan of discomfort out of the girl.
+	A recognizable little representation of one of your slaves is lying before her as she runs her wand over her body. The slave must be getting a checkup. She notices your gaze and taps the wand to the slave's breasts, causing them to jump a cup size.
 <<elseif ($seed == 5) && ($invasionVictory > 0)>>
-	She's flapping around in circles chasing a representation of one of your security drones with a mallet. When she sees you looking at her, she quickly hides the hammer behing her back, giggles and says, "He let some get away and needed to be punished!"
+	She's riding a broom alongside a representation of one of your security drones as it carries out its patrol route through your arcolgy. When she sees you looking at her, she giggles and says, "I like this one. He did very well during the invasion."
 <<elseif ($seed == 6) && ($studio == 1)>>
-	She's hovering over a recognizable little representation of one of your slaves masturbate while holding a handheld camera to film the action, gonzo style. The slave must be using one of the penthouse's many vibrators, and $assistantName is clearly turning the feed of it into a PoV porno.
+	A hovering camera is aimed at a recognizable little representation of one of your slaves masturbate. The slave must be using one of the penthouse's many vibrators, and $assistantName is likely invisible holding the camera, turning the feed of it into a PoV porno.
 <<elseif ($seed == 7) && ($marketAssistantAnnounced == 1)>>
-	She's accompanied by your market assistant's slightly taller avatar.
+	She's accompanied by your market assistant's chubby, bespectacled avatar.
 	<<if $marketAssistantRelationship == "cute">>
 		They're tormenting a little representation of one of your slaves while gigling to each other. A closer inspection reveals they are playing with the door locks to confound a new menial.
 	<<elseif $marketAssistantRelationship == "nonconsensual">>
diff --git a/src/uncategorized/retrieve.tw b/src/uncategorized/retrieve.tw
index c463ef78f06b6404a70785aa46aae66a053e8c56..029e8b1ce5b3af106c580b8ee926e66e96e1fb2b 100644
--- a/src/uncategorized/retrieve.tw
+++ b/src/uncategorized/retrieve.tw
@@ -3,6 +3,7 @@
 <<set $activeSlave = $slaves[$i], _ID = $activeSlave.ID, _SL = $slaves.length>>
 
 <<removeJob $activeSlave $returnTo>>
+
 <<switch $returnTo>>
 <<case "Pit">>
 	<<for _i = 0; _i < $fighterIDs.length; _i++>>
diff --git a/src/uncategorized/rulesAssistant.tw b/src/uncategorized/rulesAssistant.tw
index 9845a48679194359c7fb001e354ec9cf9acaea4e..d068d1e974d4885bd220b18fc392f2db08997e55 100644
--- a/src/uncategorized/rulesAssistant.tw
+++ b/src/uncategorized/rulesAssistant.tw
@@ -1,151 +1,150 @@
 :: Rules Assistant [nobr]
 
-<<set $nextButton = "Back to Main">>
-<<set $nextLink = "Main">>
-<<set $returnTo = "Main">>
+<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Main">>
 <<set $showEncyclopedia = 1, $encyclopedia = "Personal Assistant">>
 
 <<if $defaultRules.length > 0>>
 
-<<for _r = 0; _r < $defaultRules.length; _r++>>
-<<if $currentRule.ID == $defaultRules[_r].ID >>
-<<set $r = _r+1>>
-<<break>>
-<</if>>
-<</for>>
-<center>
-<<if $r > 1>>
-	@@.cyan;[Shift+←,Shift+Q] @@<span id="firstRule">
-	<strong>
-	<<link "First">>
-		<<set $currentRule.facility = _facility>>
-		<<set $currentRule.excludeFacility = _excludeFacility>>
-		<<set $currentRule = $defaultRules[0]>>
-		<<goto "Rules Assistant">>
-	<</link>>
-	</strong>
-	</span>  |  
-
-	@@.cyan;[←,Q] @@<span id="prevRule">
-	<strong>
-	<<link "Prev">>
-		<<set $currentRule.facility = _facility>>
-		<<set $currentRule.excludeFacility = _excludeFacility>>
-		<<set $currentRule = $defaultRules[_r-1]>>
-		<<goto "Rules Assistant">>
-	<</link>>
-	</strong>
-	</span>
-<<else>>
-[Shift+←,Shift+Q] First  |  [←,Q] Prev
-<</if>>
-&nbsp;&nbsp;&nbsp;&nbsp;''Viewing Rule $r of $defaultRules.length''&nbsp;&nbsp;&nbsp;&nbsp;
-<<if _r+1 < $defaultRules.length>>
-	<span id="nextRule">
-	<strong>
-	<<link "Next">>
-		<<set $currentRule.facility = _facility>>
-		<<set $currentRule.excludeFacility = _excludeFacility>>
-		<<set $currentRule = $defaultRules[_r+1]>>
-		<<goto "Rules Assistant">>
-	<</link>>
-	</strong>
-	</span>@@.cyan; [E,→]@@  |  
-<<else>>
-Next [E,→]  |  
-<</if>>
+	<<for _r = 0; _r < $defaultRules.length; _r++>>
+		<<if $currentRule.ID == $defaultRules[_r].ID>>
+			<<set $r = _r+1>>
+			<<break>>
+		<</if>>
+	<</for>>
+	
+	/* backwards compatibility */
+	<<if ndef $currentRule.assignment>>			<<set $currentRule.assignment = []>>		<</if>>
+	<<if ndef $currentRule.excludeAssignment>>	<<set $currentRule.excludeAssignment = []>>	<</if>>
+	<<if ndef $currentRule.excludedSlaves>>		<<set $currentRule.excludedSlaves = []>>	<</if>>
+	<<if ndef $currentRule.selectedSlaves>>		<<set $currentRule.selectedSlaves = []>>	<</if>>
+	<<if ndef $currentRule.facility>>			<<set $currentRule.facility = []>>			<</if>>
+	<<if ndef $currentRule.excludeFacility>>	<<set $currentRule.excludeFacility = []>>	<</if>>
+	
+	<center>
+		<<if $r > 1>>
+			@@.cyan;[Shift+←,Shift+Q] @@<span id="firstRule">
+			<strong>
+			<<link "First">>
+				<<set $currentRule.facility = _facility>>
+				<<set $currentRule.excludeFacility = _excludeFacility>>
+				<<set $currentRule = $defaultRules[0]>>
+				<<goto "Rules Assistant">>
+			<</link>>
+			</strong>
+			</span>
+				|	
+			@@.cyan;[←,Q] @@<span id="prevRule">
+			<strong>
+			<<link "Prev">>
+				<<set $currentRule.facility = _facility>>
+				<<set $currentRule.excludeFacility = _excludeFacility>>
+				<<set $currentRule = $defaultRules[_r-1]>>
+				<<goto "Rules Assistant">>
+			<</link>>
+			</strong>
+			</span>
+		<<else>>
+			[Shift+←,Shift+Q] First  |  [←,Q] Prev
+		<</if>>
 
-<<if $r != $defaultRules.length && $defaultRules[$defaultRules.length-1]>>
-<span id="lastRule">
-	<strong>
-	<<link "Last">>
-		<<set $currentRule.facility = _facility>>
-		<<set $currentRule.excludeFacility = _excludeFacility>>
-		<<set $currentRule = $defaultRules[$defaultRules.length-1]>>
-		<<goto "Rules Assistant">>
-	<</link>>
-	</strong>
-	</span>@@.cyan; [Shift+E,Shift+→]@@
-<<else>>
-Last [Shift+E,Shift+→]
-<</if>>
-</center>
-<br>
-<center>
-<<if _r > 0>>
-	<<print $defaultRules[_r-1].name+" <- ">>
-<</if>>
-  <strong>$currentRule.name</strong> 
-<<if _r < $defaultRules.length-1>>
-	<<print " -> "+$defaultRules[_r+1].name>>
-<</if>>
-</center>
-<center>
-
-<span id="ruleDown">
-    <<if _r > 0>>
-	<<link "Lower Priority">>
-	<<set _tmpRule = $defaultRules[_r]>>
-	<<set $defaultRules[_r] = $defaultRules[_r-1]>>
-	<<set $defaultRules[_r-1] = _tmpRule>>
-	<<goto "Rules Assistant">>
-	<</link>>
-    <<else>>
-	Lower Priority
-    <</if>>
-</span>
+		&nbsp;&nbsp;&nbsp;&nbsp;''Viewing Rule $r of $defaultRules.length''&nbsp;&nbsp;&nbsp;&nbsp;
+
+		<<if _r+1 < $defaultRules.length>>
+			<span id="nextRule">
+			<strong>
+			<<link "Next">>
+				<<set $currentRule.facility = _facility>>
+				<<set $currentRule.excludeFacility = _excludeFacility>>
+				<<set $currentRule = $defaultRules[_r+1]>>
+				<<goto "Rules Assistant">>
+			<</link>>
+			</strong>
+			</span>@@.cyan; [E,→]@@  |  
+		<<else>>
+			Next [E,→]  |  
+		<</if>>
 
- | <span id="rulename">
-<<if ndef $currentRule.name>>
-	<<set $currentRule.name = "Rule " + $r>>
-<</if>>
-</span>
-<<link "Rename">>
-<<replace "#rulename">>
-	<<textbox "$currentRule.name" $currentRule.name "Rules Assistant">>
-<</replace>>
-<</link>> 
- | 
-<span id="ruleUp">
-    <<if _r < $defaultRules.length-1>>
-	<<link "Higher Priority">>
-	<<set _tmpRule = $defaultRules[_r]>>
-	<<set $defaultRules[_r] = $defaultRules[_r+1]>>
-	<<set $defaultRules[_r+1] = _tmpRule>>
-	<<goto "Rules Assistant">>
-	<</link>> 
-    <<else>>
-	Higher Priority    
-    <</if>>
-</span>
-</center>
+		<<if $r != $defaultRules.length && $defaultRules[$defaultRules.length-1]>>
+			<span id="lastRule">
+			<strong>
+			<<link "Last">>
+				<<set $currentRule = $defaultRules[$defaultRules.length-1]>>
+				<<goto "Rules Assistant">>
+			<</link>>
+			</strong>
+			</span>@@.cyan; [Shift+E,Shift+→]@@
+		<<else>>
+			Last [Shift+E,Shift+→]
+		<</if>>
+	</center>
 
-<center>
-	<br><span id="rulename">
-	<<if ndef $currentRule.name>>
-		<<set $currentRule.name = "Rule " + $r>>
-	<</if>>
-	$currentRule.name |
-	</span>
-	<<link "Rename">>
-	<<replace "#rulename">>
-		<<textbox "$currentRule.name" $currentRule.name "Rules Assistant">>
-	<</replace>>
-	<</link>>
-</center>
-<</if>>
+	<center>
+		<<if _r > 0>>
+			<<print $defaultRules[_r-1].name+" &emsp; <- &emsp;&emsp;">>
+		<<else>>
+			<<print "&emsp;&emsp;&emsp;&emsp;&emsp;">>
+		<</if>>
+
+		<span id="rulename">
+		<<if ndef $currentRule.name>>
+			<<set $currentRule.name = "Rule " + $r>>
+		<</if>>
+		@@.yellow;$currentRule.name@@
+		</span>
+
+		<<if _r < $defaultRules.length-1>>
+			<<print "&emsp;&emsp; -> &emsp; "+$defaultRules[_r+1].name>>
+		<<else>>
+			<<print "&emsp;&emsp;&emsp;&emsp;&emsp;">>
+		<</if>>
+	</center>
+
+	<center>
+		<span id="ruleDown">
+			<<if _r > 0>>
+			<<link "Lower Priority">>
+			<<set _tmpRule = $defaultRules[_r]>>
+			<<set $defaultRules[_r] = $defaultRules[_r-1]>>
+			<<set $defaultRules[_r-1] = _tmpRule>>
+			<<goto "Rules Assistant">>
+			<</link>>
+			<<else>>
+			Lower Priority
+			<</if>>
+		</span>
+			|
+		<<link "Rename">>
+			<<replace "#rulename">>
+				<<textbox "$currentRule.name" $currentRule.name "Rules Assistant">>
+			<</replace>>
+		<</link>>
+			|
+		<span id="ruleUp">
+			<<if _r < $defaultRules.length-1>>
+				<<link "Higher Priority">>
+					<<set _tmpRule = $defaultRules[_r]>>
+					<<set $defaultRules[_r] = $defaultRules[_r+1]>>
+					<<set $defaultRules[_r+1] = _tmpRule>>
+					<<goto "Rules Assistant">>
+				<</link>> 
+			<<else>>
+				Higher Priority
+			<</if>>
+		</span>
+	</center>
+<</if>> /* closes if $defaultRules.length > 0 */
 
 <br>
+
 //<<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Sir<<else>>Ma'am<</if>>, I will review your slaves and make changes that will have a beneficial effect. Apologies, sir, but this function is... not fully complete. It may have some serious limitations. Please use the 'no default setting' option to identify areas I should not address.//
 
 <br><br>
 
 <<if $defaultRules.length < 1>>
 ''No rules.''
+
 <<else>>
 
-<<set _facility = $currentRule.facility>>
-<<set _excludeFacility = $currentRule.excludeFacility>>
 __Rule $r Automatic Activation__
 <span id ="activation">
 </span>
@@ -255,42 +254,40 @@ __Rule $r Automatic Activation__
 <<RAChangeApplyAssignment>>
 <</timed>>
 
-<br>
-
 <span id = "excludeassignment">
 </span>
 <<timed 50ms>>
 <<RAChangeExcludeAssignment>>
 <</timed>>
 
-<<set _facility = $currentRule.facility>>
-
-<<if (ndef _facility)>>
-	<<set _facility = []>>
-<</if>>
-
 <span id = "applyfacility">
 </span>
 <<timed 50ms>>
 <<RAChangeApplyFacility>>
 <</timed>>
 
-<<set _excludeFacility = $currentRule.excludeFacility>>
-
-<<if (ndef _excludeFacility)>>
-	<<set _excludeFacility = []>>
-<</if>>
-
 <span id = "excludefacility">
 </span>
 <<timed 50ms>>
 <<RAChangeExcludeFacility>>
 <</timed>>
 
-<br><br>
+<span id="specialslaves"></span>
+<<timed 50ms>>
+<<RASpecialSlaves>>
+<</timed>>
 
-<<if ndef $currentRule.setAssignment>>
-	<<set $currentRule.setAssignment = "none">>
+&nbsp;&nbsp;&nbsp;&nbsp;
+
+<<if $currentRule.selectedSlaves.length < 1 && $currentRule.excludedSlaves.length < 1>>
+  @@.gray;Specific slaves:@@
+	''Not limited to nor excluding any specific slaves'' | [[Choose specific slaves|Rules Slave Select][$currentRule.excludedSlaves = []]] | [[Exclude specific slaves|Rules Slave Exclude][$currentRule.selectedSlaves = []]]
+<<elseif $currentRule.selectedSlaves.length < 1 && $currentRule.excludedSlaves.length > 0>>
+  Exclude specific slaves:
+	[[Currently excluding specific slaves|Rules Slave Exclude]] | [[Don't exclude specific slaves|Rules Assistant][$currentRule.excludedSlaves = []]]
+<<else>>
+  Apply to specific slaves:
+	[[Currently limited to specific slaves|Rules Slave Select]] | [[Don't limit to specific slaves|Rules Assistant][$currentRule.selectedSlaves = [], $currentRule.excludedSlaves = []]]
 <</if>>
 
 <span id = "setassignment">
@@ -305,25 +302,6 @@ __Rule $r Automatic Activation__
 <<RAChangeAssignFacility>>
 <</timed>>
 
-<br><br>
-Apply to slaves:<br>
-<<if ((ndef $currentRule.selectedSlaves) || ($currentRule.selectedSlaves.length < 1)) && ((ndef $currentRule.excludedSlaves) || ($currentRule.excludedSlaves.length < 1))>>
-''Currently applied to all slaves'' | [[Choose specific slaves|Rules Slave Select]]
-<<elseif ((ndef $currentRule.selectedSlaves) || ($currentRule.selectedSlaves.length < 1)) && (def $currentRule.excludedSlaves) && ($currentRule.excludedSlaves.length > 0)>>
-''Currently applied to all slaves except excluded slaves'' | [[Choose specific slaves|Rules Slave Select]] | [[Apply to all slaves|Rules Assistant][$currentRule.selectedSlaves = [],$currentRule.excludedSlaves = []]]
-<<else>>
-[[Currently applied to specific slaves|Rules Slave Select]] | [[Apply to all slaves|Rules Assistant][$currentRule.selectedSlaves = [], $currentRule.excludedSlaves = []]]
-<</if>>
-<br>
-Exclude slaves:<br>
-<<if ndef $currentRule.excludedSlaves || $currentRule.excludedSlaves.length < 1>>
-''Not excluding any slaves'' |
-
-[[Exclude specific slaves|Rules Slave Exclude]]
-<<else>>
-[[Currently excluding specific slaves|Rules Slave Exclude]] | [[Don't exclude slaves|Rules Assistant][$currentRule.excludedSlaves = []]]
-<</if>>
-
 <br><br>
 
 __Rule $r Default Appearance:__
@@ -1094,7 +1072,7 @@ Vaginal accessories for other slaves: ''$currentRule.vaginalAccessory.''
 	<<RAChangeApply>>
 <</link>>
 
-<<if $seeDicks != 0>>
+
 <br>
 <span id = "avdaccessory">
 Dick accessories for anal virgins: ''$currentRule.aVirginDickAccessory.''
@@ -1173,7 +1151,7 @@ Dick accessories for other slaves: ''$currentRule.dickAccessory.''
 	<<RAChangeSave>>
 	<<RAChangeApply>>
 <</link>>
-<</if>>
+
 
 <br>
 
@@ -1260,11 +1238,7 @@ Buttplugs for other slaves: ''$currentRule.buttplug.''
 //Will permanently gape assholes//
 
 <br><br>
-[[Cosmetic Rules Assistant Settings]]
-<br>
-[[Body Mod Rules Assistant Settings]]
-<br>
-[[Autosurgery Settings]]
+[[Cosmetic Rules Assistant Settings]] | [[Body Mod Rules Assistant Settings]] | [[Autosurgery Settings]]
 
 <br><br>
 
@@ -2530,7 +2504,7 @@ Relationship rules: ''$currentRule.relationshipRules.''
 
 <</if>>
 
-<br>
+
 <span id="saveresult">
 </span>
 <<timed 50ms>>
@@ -2824,79 +2798,51 @@ Relationship rules: ''$currentRule.relationshipRules.''
 
 <br>
 
-<span id="applied">
-</span>
 <<if $defaultRules.length < 10>>
-<br>
+	<br>
+
 	<<link "Add a new rule">>
 
-	<<set _activeRule = {aphrodisiacs: "no default setting", activation: "none", thresholdLower: 4, thresholdUpper: "none", eqLower: true, eqUpper: true, releaseRules: "no default setting", clitSetting: "no default setting", clitSettingXY: "no default setting", clitSettingXX: "no default setting", clitSettingEnergy: "no default setting", speechRules: "no default setting", clothes: "no default setting", fuckdoll: 0, choosesOwnClothes: 0, collar: "no default setting", shoes: "no default setting", virginAccessory: "no default setting", aVirginAccessory: "no default setting", vaginalAccessory: "no default setting", aVirginDickAccessory: "no default setting", dickAccessory: "no default setting", cSec: 0, bellyAccessory: "no default setting", aVirginButtplug: "no default setting", buttplug: "no default setting", markings: "none", eyeColor: "no default setting", makeup: "no default setting", nails: "no default setting", hColor: "no default setting", hLength: "no default setting", hStyle: "no default setting", pubicHColor: "no default setting", pubicHStyle: "no default setting", nipplesPiercing: "no default setting", areolaePiercing: "no default setting", clitPiercing: "no default setting", vaginaLube: "no default setting", vaginaPiercing: "no default setting", analArea: 1, dickPiercing: "no default setting", anusPiercing: "no default setting", lipsPiercing: "no default setting", tonguePiercing: "no default setting", earPiercing: "no default setting", nosePiercing: "no default setting", eyebrowPiercing: "no default setting", navelPiercing: "no default setting", corsetPiercing: "no default setting", boobsTat: "no default setting", buttTat: "no default setting", vaginaTat: "no default setting", dickTat: "no default setting", lipsTat: "no default setting", anusTat: "no default setting", shouldersTat: "no default setting", armsTat: "no default setting", legsTat: "no default setting", backTat: "no default setting", stampTat: "no default setting", curatives: "no default setting", livingRules: "no default setting", relationshipRules: "no default setting", standardPunishment: "no default setting", standardReward: "no default setting", useRulesAssistant: 1, diet: "no default setting", dietCum: "no default setting", dietMilk: "no default setting", muscles: "no default setting", XY: "no default setting", XX: "no default setting", gelding: "no default setting", preg: "no default setting", growth: "no default setting", autoSurgery: 0, choosesOwnAssignment: 0, lactation: 0, autoBrand: 0, pornFameSpending: "no default setting", dietGrowthSupport: 0, eyewear: "no default setting", assignment: [], excludeAssignment: [], setAssignment: "none", facility: [], excludeFacility: [], assignFacility: "none", excludeSpecialSlaves: true, facilityRemove: false, removalAssignment: "rest", selectedSlaves: [], excludedSlaves: [], surgery: {lactation: "no default setting", cosmetic: 0, accent: "no default setting", shoulders: "no default setting", shouldersImplant: "no default setting", boobs: "no default setting", hips: "no default setting", hipsImplant: "no default setting", butt: "no default setting", faceShape: "no default setting", lips: "no default setting", holes: 0}, underArmHColor: "no default setting", underArmHStyle: "no default setting" }>>
+		<<set _activeRule = {aphrodisiacs: "no default setting", activation: "none", thresholdLower: 4, thresholdUpper: "none", eqLower: true, eqUpper: true, releaseRules: "no default setting", clitSetting: "no default setting", clitSettingXY: "no default setting", clitSettingXX: "no default setting", clitSettingEnergy: "no default setting", speechRules: "no default setting", clothes: "no default setting", fuckdoll: 0, choosesOwnClothes: 0, collar: "no default setting", shoes: "no default setting", virginAccessory: "no default setting", aVirginAccessory: "no default setting", vaginalAccessory: "no default setting", aVirginDickAccessory: "no default setting", dickAccessory: "no default setting", cSec: 0, bellyAccessory: "no default setting", aVirginButtplug: "no default setting", buttplug: "no default setting", markings: "none", eyeColor: "no default setting", makeup: "no default setting", nails: "no default setting", hColor: "no default setting", hLength: "no default setting", hStyle: "no default setting", pubicHColor: "no default setting", pubicHStyle: "no default setting", nipplesPiercing: "no default setting", areolaePiercing: "no default setting", clitPiercing: "no default setting", vaginaLube: "no default setting", vaginaPiercing: "no default setting", analArea: 1, dickPiercing: "no default setting", anusPiercing: "no default setting", lipsPiercing: "no default setting", tonguePiercing: "no default setting", earPiercing: "no default setting", nosePiercing: "no default setting", eyebrowPiercing: "no default setting", navelPiercing: "no default setting", corsetPiercing: "no default setting", boobsTat: "no default setting", buttTat: "no default setting", vaginaTat: "no default setting", dickTat: "no default setting", lipsTat: "no default setting", anusTat: "no default setting", shouldersTat: "no default setting", armsTat: "no default setting", legsTat: "no default setting", backTat: "no default setting", stampTat: "no default setting", curatives: "no default setting", livingRules: "no default setting", relationshipRules: "no default setting", standardPunishment: "no default setting", standardReward: "no default setting", useRulesAssistant: 1, diet: "no default setting", dietCum: "no default setting", dietMilk: "no default setting", muscles: "no default setting", XY: "no default setting", XX: "no default setting", gelding: "no default setting", preg: "no default setting", growth: "no default setting", autoSurgery: 0, choosesOwnAssignment: 0, lactation: 0, autoBrand: 0, pornFameSpending: "no default setting", dietGrowthSupport: 0, eyewear: "no default setting", assignment: [], excludeAssignment: [], setAssignment: "none", facility: [], excludeFacility: [], assignFacility: "none", excludeSpecialSlaves: true, facilityRemove: false, removalAssignment: "rest", selectedSlaves: [], excludedSlaves: [], surgery: {lactation: "no default setting", cosmetic: 0, accent: "no default setting", shoulders: "no default setting", shouldersImplant: "no default setting", boobs: "no default setting", hips: "no default setting", hipsImplant: "no default setting", butt: "no default setting", faceShape: "no default setting", lips: "no default setting", holes: 0}, underArmHColor: "no default setting", underArmHStyle: "no default setting" }>>
 
-	<<if ndef _r>>
-		<<set _r = 0>>
-		<<set $r = 1>>
-	<</if>>
+		<<if ndef _r>>
+			<<set _r = 0>>
+			<<set $r = 1>>
+		<</if>>
 
-	<<if $defaultRules.length > 0>>
-		<<set _length to ($defaultRules.length+1)>>
-		<<set $RulesID to $RulesID+1>>
-	<<else>>
-		<<set _length to 1>>
-		<<set $RulesID to 1>>
-	<</if>>
+		<<if $defaultRules.length > 0>>
+			<<set _length to ($defaultRules.length+1)>>
+			<<set $RulesID to $RulesID+1>>
+		<<else>>
+			<<set _length to 1>>
+			<<set $RulesID to 1>>
+		<</if>>
 
-	<<set _activeRule.name = "Rule " + _length>>
-	<<set _activeRule.ID = $RulesID>>
+		<<set _activeRule.name = "Rule " + _length>>
+		<<set _activeRule.ID = $RulesID>>
 
-	<<set $defaultRules.push(_activeRule)>>
+		<<set $defaultRules.push(_activeRule)>>
 
-	<<set $currentRule = $defaultRules[$defaultRules.length-1]>>
-	<<goto "Rules Assistant">>
+		<<set $currentRule = $defaultRules[$defaultRules.length-1]>>
+		<<goto "Rules Assistant">>
+		
 	<</link>>
 
 <</if>>
+
 <<if $defaultRules.length > 0>>
-|
-<span id="apply">
-<span id="applyresult">
-<<link "Apply rules">>
-	<<replace "#applyresult">>
-	//Rules applied.//
-	<</replace>>
-	<<replace "#applied">>
-	<<for _t = 0; _t < $defaultRules.length; _t++>>
-		<<if $currentRule.ID == $defaultRules[_t].ID>>
-			<<set $currentRule.facility = _facility>>
-			<<set $currentRule.excludeFacility = _excludeFacility>>
-			<<if $currentRule.thresholdLower != "none">>
-				<<set $currentRule.thresholdLower = Number($currentRule.thresholdLower)>>
-			<</if>>
-			<<if $currentRule.thresholdUpper != "none">>
-				<<set $currentRule.thresholdUpper = Number($currentRule.thresholdUpper)>>
-			<</if>>
-			<<set $defaultRules[_t] = $currentRule>>
-		<</if>>
-	<</for>>
-	<<for $s = 0; $s < $slaves.length; $s++>>
-		<<if $slaves[$s].useRulesAssistant == 1>>
-			<<CheckAutoRulesActivate $slaves[$s]>>
-			<<DefaultRules $slaves[$s]>>
-		<</if>>
-	<</for>>
-	<<for _t = 0; _t < $defaultRules.length; _t++>>
-		<<set _r = $r-1>>
-		<<if $defaultRules[_t].ID == $defaultRules[_r].ID>>
-			<<set $currentRule = $defaultRules[_t]>>
-			<<set _facility = $currentRule.facility>>
-			<<set _excludeFacility = $currentRule.excludeFacility>>
-			<<break>>
-		<</if>>
-	<</for>>
-	<</replace>>
-<</link>>
-</span>
-</span>
-<br><br>
-[[Export this rule|Export Rule]]
+	| <span id="apply">
+		<span id="applied"></span>
+		<span id="applyresult"></span>
+	</span>
+	<<timed 50ms>>
+	<<RAChangeApply>>
+	<</timed>>
+
+	<br><br>
+
+	[[Export this rule|Export Rule]]
 <</if>>
+
 | [[Import a rule|Import Rule]]
+
diff --git a/src/uncategorized/rulesFacilityRemove.tw b/src/uncategorized/rulesFacilityRemove.tw
index 8829b6cb9c0ba4b88989d0667bf20ad3b5580c3c..8ed1b0153c4dbbc1837cf01d0def4aaef7212200 100644
--- a/src/uncategorized/rulesFacilityRemove.tw
+++ b/src/uncategorized/rulesFacilityRemove.tw
@@ -6,97 +6,86 @@
 	<<case "brothel">>
 		<<if $activeSlave.assignment == "work in the brothel">>
 			<<if ($Madam == 0) || ($Madam.ID != $activeSlave.ID)>>
-				<<removeJob $activeSlave _currentRule.assignFacility>>
-				<<set $activeSlave.assignment = _currentRule.removalAssignment>>
-				<br>$activeSlave.slaveName has been removed from $brothelName and has been assigned to $activeSlave.assignment
+				<br>$activeSlave.slaveName has been removed from $brothelName and has been assigned to _currentRule.removalAssignment.
+				<<assignJob $activeSlave _currentRule.removalAssignment>>
 			<</if>>
 		<</if>>
 
 	<<case "club">>
 		<<if $activeSlave.assignment == "serve in the club">>
 			<<if ($DJ == 0) || ($DJ.ID != $activeSlave.ID)>>
-				<<removeJob $activeSlave _currentRule.assignFacility>>
-				<<set $activeSlave.assignment = _currentRule.removalAssignment>>
-				<br>$activeSlave.slaveName has been removed from $clubName and has been assigned to $activeSlave.assignment
+				<br>$activeSlave.slaveName has been removed from $clubName and has been assigned to _currentRule.removalAssignment.
+				<<assignJob $activeSlave _currentRule.removalAssignment>>
 			<</if>>
 		<</if>>
 
 	<<case "dairy">>
 		<<if $activeSlave.assignment == "work in the dairy">>
 			<<if ($Milkmaid == 0) || ($Milkmaid.ID != $activeSlave.ID)>>
-				<<removeJob $activeSlave _currentRule.assignFacility>>
-				<<set $activeSlave.assignment = _currentRule.removalAssignment>>
-				<br>$activeSlave.slaveName has been removed from $dairyName and has been assigned to $activeSlave.assignment
+				<br>$activeSlave.slaveName has been removed from $dairyName and has been assigned to _currentRule.removalAssignment.
+				<<assignJob $activeSlave _currentRule.removalAssignment>>
 			<</if>>
 		<</if>>
 
 	<<case "arcade">>
 		<<if $activeSlave.assignment == "be confined in the arcade">>
-				<<removeJob $activeSlave _currentRule.assignFacility>>
-			<<set $activeSlave.assignment = _currentRule.removalAssignment>>
-			<br>$activeSlave.slaveName has been removed from $arcadeName and has been assigned to $activeSlave.assignment
+			<br>$activeSlave.slaveName has been removed from $arcadeName and has been assigned to _currentRule.removalAssignment.
+			<<assignJob $activeSlave _currentRule.removalAssignment>>
 		<</if>>
 
 	<<case "spa">>
 		<<if $activeSlave.assignment == "rest in the spa">>
 			<<if ($Attendant == 0) || ($Attendant.ID != $activeSlave.ID)>>
-				<<removeJob $activeSlave _currentRule.assignFacility>>
-				<<set $activeSlave.assignment = _currentRule.removalAssignment>>
-				<br>$activeSlave.slaveName has been removed from $spaName and has been assigned to $activeSlave.assignment
+				<br>$activeSlave.slaveName has been removed from $spaName and has been assigned to _currentRule.removalAssignment.
+				<<assignJob $activeSlave _currentRule.removalAssignment>>
 			<</if>>
 		<</if>>
 
 	<<case "clinic">>
 		<<if $activeSlave.assignment == "get treatment in the clinic">>
 			<<if ($Nurse == 0) || ($Nurse.ID != $activeSlave.ID)>>
-				<<removeJob $activeSlave _currentRule.assignFacility>>
-				<<set $activeSlave.assignment = _currentRule.removalAssignment>>
-				<br>$activeSlave.slaveName has been removed from $clinicName and has been assigned to $activeSlave.assignment
+				<br>$activeSlave.slaveName has been removed from $clinicName and has been assigned to _currentRule.removalAssignment.
+				<<assignJob $activeSlave _currentRule.removalAssignment>>
 			<</if>>
 		<</if>>
 
 	<<case "mastersuite">>
 		<<if $activeSlave.assignment == "serve in the master suite">>
 			<<if ($Concubine == 0) || ($Concubine.ID != $activeSlave.ID)>>
-				<<removeJob $activeSlave _currentRule.assignFacility>>
-				<<set $activeSlave.assignment = _currentRule.removalAssignment>>
-				<br>$activeSlave.slaveName has been removed from $masterSuiteName and has been assigned to $activeSlave.assignment
+				<br>$activeSlave.slaveName has been removed from $masterSuiteName and has been assigned to _currentRule.removalAssignment.
+				<<assignJob $activeSlave _currentRule.removalAssignment>>
 			<</if>>
 		<</if>>
 
 	<<case "hgsuite">>
 		<<if $activeSlave.assignment == "live with your Head Girl">>
 			<<if ($HeadGirl == 0) || ($HeadGirl.ID != $activeSlave.ID)>>
-				<<removeJob $activeSlave _currentRule.assignFacility>>
-				<<set $activeSlave.assignment = _currentRule.removalAssignment>>
-				<br>$activeSlave.slaveName has been removed from $HGSuiteName and has been assigned to $activeSlave.assignment
+				<br>$activeSlave.slaveName has been removed from $HGSuiteName and has been assigned to _currentRule.removalAssignment.
+				<<assignJob $activeSlave _currentRule.removalAssignment>>
 			<</if>>
 		<</if>>
 
 	<<case "servantsquarters">>
 		<<if $activeSlave.assignment == "work as a servant">>
 			<<if ($Stewardess == 0) || ($Stewardess.ID != $activeSlave.ID)>>
-				<<removeJob $activeSlave _currentRule.assignFacility>>
-				<<set $activeSlave.assignment = _currentRule.removalAssignment>>
-				<br>$activeSlave.slaveName has been removed from $servantsQuartersName and has been assigned to $activeSlave.assignment
+				<br>$activeSlave.slaveName has been removed from $servantsQuartersName and has been assigned to _currentRule.removalAssignment.
+				<<assignJob $activeSlave _currentRule.removalAssignment>>
 			<</if>>
 		<</if>>
 
 	<<case "schoolroom">>
 		<<if $activeSlave.assignment == "learn in the schoolroom">>
 			<<if ($Schoolteacher == 0) || ($Schoolteacher.ID != $activeSlave.ID)>>
-				<<removeJob $activeSlave _currentRule.assignFacility>>
-				<<set $activeSlave.assignment = _currentRule.removalAssignment>>
-				<br>$activeSlave.slaveName has been removed from $schoolroomName and has been assigned to $activeSlave.assignment
+				<br>$activeSlave.slaveName has been removed from $schoolroomName and has been assigned to _currentRule.removalAssignment.
+				<<assignJob $activeSlave _currentRule.removalAssignment>>
 			<</if>>
 		<</if>>
 
 	<<case "cellblock">>
 		<<if $activeSlave.assignment == "be confined in the cellblock">>
 			<<if ($Wardeness == 0) || ($Wardeness.ID != $activeSlave.ID)>>
-				<<removeJob $activeSlave _currentRule.assignFacility>>
-				<<set $activeSlave.assignment = _currentRule.removalAssignment>>
-				<br>$activeSlave.slaveName has been removed from $cellblockName and has been assigned to $activeSlave.assignment
+				<br>$activeSlave.slaveName has been removed from $cellblockName and has been assigned to _currentRule.removalAssignment.
+				<<assignJob $activeSlave _currentRule.removalAssignment>>
 			<</if>>
 		<</if>>
 	<</switch>>
diff --git a/src/uncategorized/rulesSlaveExclude.tw b/src/uncategorized/rulesSlaveExclude.tw
index 49a95d70e451c53283c1a48f4ce6e38c7a2b6503..85f05221e4010ff903154479891687da5f33e7ab 100644
--- a/src/uncategorized/rulesSlaveExclude.tw
+++ b/src/uncategorized/rulesSlaveExclude.tw
@@ -1,25 +1,23 @@
 :: Rules Slave Exclude
 
 <<nobr>>
-<<set $nextButton = "Continue">>
-<<set $nextLink = "Rules Assistant">>
-<<if ndef $currentRule.excludedSlaves>>
-	<<set $currentRule.excludedSlaves to []>>
-<</if>>
+<<set $nextButton = "Continue", $nextLink = "Rules Assistant">>
+
 <<if ($currentRule.selectedSlaves.length < 1) && ($currentRule.excludedSlaves.length < 1)>>
-	No slaves excluded from Rule $r
+	No slaves are excluded from Rule $r.
 	<br><br>
 	<<set $Flag = 0>>
-	Exclude selected slaves from rule $r:
+	Exclude selected slaves from Rule $r:
 	<<include "Slave Summary">>
 <<else>>
 	Slaves excluded from Rule $r:
 	<<set $Flag = 1>>
 	<<include "Slave Summary">>
 	<br><br>
-	Exclude selected slaves from rule $r:
+	[[Do not exclude any slaves|Rules Slave Exclude][$currentRule.excludedSlaves = []]]
+	<br><br>
+	Exclude selected slaves from Rule $r:
 	<<set $Flag = 0>>
 	<<include "Slave Summary">>
-	<br>[[Do not exclude any slaves|Rules Slave Exclude][$currentRule.excludeSlaves = []]]
 <</if>>
 <</nobr>>
diff --git a/src/uncategorized/rulesSlaveSelect.tw b/src/uncategorized/rulesSlaveSelect.tw
index 019e316072d715c7e5c1e382b8b167c4bd9840f3..1f9a21022d209180d40aa8f1108ee99b69299ce6 100644
--- a/src/uncategorized/rulesSlaveSelect.tw
+++ b/src/uncategorized/rulesSlaveSelect.tw
@@ -1,34 +1,29 @@
 :: Rules Slave Select
 
 <<nobr>>
-<<set $nextButton = "Continue">>
-<<set $nextLink = "Rules Assistant">>
+<<set $nextButton = "Continue", $nextLink = "Rules Assistant">>
 
-<<if ndef $currentRule.selectedSlaves>>
-	<<set $currentRule.selectedSlaves to []>>
-<</if>>
-
-<<if ((ndef $currentRule.selectedSlaves) || ($currentRule.selectedSlaves.length < 1)) && ((ndef $currentRule.excludedSlaves) || ($currentRule.excludedSlaves.length < 1))>>
-	Rule $r currently applied to all slaves.
+<<if $currentRule.selectedSlaves.length < 1 && $currentRule.excludedSlaves.length < 1>>
+	Rule $r is currently applied to all slaves.
 	<br><br>
 	<<set $Flag = 0>>
-	Apply rule $r to selected slaves:
+	Apply Rule $r to selected slaves only:
 	<<include "Slave Summary">>
-<<elseif ($currentRule.selectedSlaves.length < 1) && ($currentRule.excludedSlaves.length > 0)>>
-	Rule $r currently applied to all slaves except excluded slaves.
+<<elseif $currentRule.selectedSlaves.length < 1 && $currentRule.excludedSlaves.length > 0>>
+	Rule $r is currently applied to all slaves except excluded slaves.
 	<br><br>
 	<<set $Flag = 0>>
-	Apply rule $r to selected slaves:
+	Apply rule $r to selected slaves only:
 	<<include "Slave Summary">>
 <<else>>
-	Rule $r currently applied to:
+	Rule $r is currently applied to:
 	<<set $Flag = 1>>
 	<<include "Slave Summary">>
 	<br><br>
-	Apply rule $r to selected slaves:
+	[[Apply to all slaves|Rules Slave Select][$currentRule.selectedSlaves = []]]
+	<br><br>
+	Apply rule $r to selected slaves only:
 	<<set $Flag = 0>>
 	<<include "Slave Summary">>
-
-	<br>[[Apply to all slaves|Rules Slave Select][$currentRule.selectedSlaves = []]]
 <</if>>
 <</nobr>>
diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw
index fd8d5775253466c5484d29b44681195bbadc76e7..5a82bddeb4a58d810f57302c78f494a5a2758ec1 100644
--- a/src/uncategorized/slaveInteract.tw
+++ b/src/uncategorized/slaveInteract.tw
@@ -418,13 +418,13 @@ __Rules Assistant__
 <<else>>
 
 __Assignment__: <strong><span id="assign">$activeSlave.assignment<<if $activeSlave.sentence>> ($activeSlave.sentence weeks)<</if>></span>.</strong>
-	<<link "Rest">><<removeJob $activeSlave $activeSlave.assignment>><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
-	| <<link "Fucktoy">><<assignJob $activeSlave "please you">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
+	  <<link "Rest">>                   <<removeJob $activeSlave $activeSlave.assignment>><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
+	| <<link "Fucktoy">>                <<assignJob $activeSlave "please you">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
 <<if $activeSlave.fuckdoll == 0>>
 <<if (($activeSlave.devotion >= -20) || (($activeSlave.trust < -20) && ($activeSlave.devotion >= -50)) || ($activeSlave.trust < -50)) && canWalk($activeSlave)>>
-	| <<link "Subordinate slave">><<assignJob $activeSlave "be a subordinate slave">><<goto "Subordinate Targeting">><</link>>
+	| <<link "Subordinate slave">>      <<assignJob $activeSlave "be a subordinate slave">><<goto "Subordinate Targeting">><</link>>
 	<<if ($activeSlave.eyes != -2)>>
-	| <<link "Servant">><<assignJob $activeSlave "be a servant">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
+	| <<link "Servant">>                <<assignJob $activeSlave "be a servant">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
 	<<else>>
 	/*| //Blind slaves cannot be servants// */
 	<</if>>
@@ -438,18 +438,18 @@ __Assignment__: <strong><span id="assign">$activeSlave.assignment<<if $activeSla
 <<else>>
 	/*| //Too resistant to take classes// */
 <</if>>
-	| <<link "Confine her">><<assignJob $activeSlave "stay confined">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
+	| <<link "Confine her">>            <<assignJob $activeSlave "stay confined">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
 <<if $activeSlave.breedingMark != 1>>
-	| <<link "Whore">><<assignJob $activeSlave "whore">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
-	| <<link "Public servant">><<assignJob $activeSlave "serve the public">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
+	| <<link "Whore">>                  <<assignJob $activeSlave "whore">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
+	| <<link "Public servant">>         <<assignJob $activeSlave "serve the public">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
 <</if>>
 <</if>>/* CLOSES FUCKDOLL CHECK */
 <<if ($activeSlave.indentureRestrictions <= 0) && $activeSlave.breedingMark != 1>>
-	| <<link "Glory hole">><<assignJob $activeSlave "work a glory hole">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
+	| <<link "Glory hole">>             <<assignJob $activeSlave "work a glory hole">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
 <</if>>
 <<if $activeSlave.fuckdoll == 0>>
 <<if ($activeSlave.lactation > 0) || ($activeSlave.balls > 0 && $activeSlave.ballType == "human")>>
-	| <<link "Get milked">><<assignJob $activeSlave "get milked">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
+	| <<link "Get milked">>             <<assignJob $activeSlave "get milked">><<replace "#assign">>$activeSlave.assignment<</replace>><<SlaveInteractFucktoy>><</link>>
 <<else>>
 	/*| //Not lactating// */
 <</if>>
diff --git a/src/uncategorized/slaveSummary.tw b/src/uncategorized/slaveSummary.tw
index 865f9af864a8cb7722ffa22a1a30b44cb8ad2c4f..c5741f9755ca5bbe73d48cedc429f58f82c3de03 100644
--- a/src/uncategorized/slaveSummary.tw
+++ b/src/uncategorized/slaveSummary.tw
@@ -464,14 +464,14 @@
 <<if $Flag == 0>>
 	<<if !ruleSlaveSelected(_Slave, $currentRule)>>
 		<br>__''
-		<<print "[[_Slave.slaveName|Rules Slave Select Workaround][$activeSlave = $slaves["+_i+"]]]">>
+		<<print "[[_Slave.slaveName|Rules Slave Select Workaround][$activeSlave = $slaves["+_i+"]]]">>''__
 	<<else>>
 		<<continue>>
 	<</if>>
 <<else>>
 	<<if ruleSlaveSelected(_Slave, $currentRule)>>
 		<br>__''
-		<<print "[[_Slave.slaveName|Rules Slave Deselect Workaround][$activeSlave = $slaves["+_i+"]]]">>
+		<<print "[[_Slave.slaveName|Rules Slave Deselect Workaround][$activeSlave = $slaves["+_i+"]]]">>''__
 	<<else>>
 		<<continue>>
 	<</if>>
@@ -480,14 +480,14 @@
 <<if $Flag == 0>>
 	<<if !ruleSlaveExcluded(_Slave, $currentRule)>>
 		<br>__''
-		<<print "[[_Slave.slaveName|Rules Slave Exclude Workaround][$activeSlave = $slaves["+_i+"]]]">>
+		<<print "[[_Slave.slaveName|Rules Slave Exclude Workaround][$activeSlave = $slaves["+_i+"]]]">>''__
 	<<else>>
 		<<continue>>
 	<</if>>
 <<else>>
 	<<if ruleSlaveExcluded(_Slave, $currentRule)>>
 		<br>__''
-		<<print "[[_Slave.slaveName|Rules Slave NoExclude Workaround][$activeSlave = $slaves["+_i+"]]]">>
+		<<print "[[_Slave.slaveName|Rules Slave NoExclude Workaround][$activeSlave = $slaves["+_i+"]]]">>''__
 	<<else>>
 		<<continue>>
 	<</if>>
diff --git a/src/uncategorized/spaReport.tw b/src/uncategorized/spaReport.tw
index 2bca6c2f10e5f587334e3e866d97bf8252ff3af3..cdb2b2f2382ccccdcdaee1b13aefa02610b5baa8 100644
--- a/src/uncategorized/spaReport.tw
+++ b/src/uncategorized/spaReport.tw
@@ -98,7 +98,7 @@
 	<<if ($slaves[_i].fetish == "mindbroken") && ($slaves[_i].health > 20) && (_attendantUsedCure == 0) && ($spaFix != 2)>>
 		<<set _attendantUsedCure = 1>>
 		<<if (random(1,100) > 90-$Attendant.devotion)>>
-			<br>&nbsp;&nbsp;&nbsp;&nbsp;@@.green;Something almost miraculous has happened.@@ $Attendant.slaveName has always refused to believe that $slaves[_i].slaveName could not be reached, and has spent weeks lavishing patient tenderness on her in $spaName. $slaves[_i].slaveName has begun to respond, and is stirring from her mental torpor.
+			<br>&nbsp;&nbsp;&nbsp;&nbsp;@@.green;Something almost miraculous has happened.@@ $Attendant.slaveName has always refused to believe that $slaves[_i].slaveName could not be reached, and has lavished patient tenderness on her in $spaName. $slaves[_i].slaveName has begun to respond, and is stirring from her mental torpor.
 		<<set $slaves[_i].devotion = -3, $slaves[_i].sexualFlaw = "apathetic", $slaves[_i].behavioralFlaw = either("hates men", "odd"), $slaves[_i].fetish = "none", $slaves[_i].fetishKnown = 1>>
 		<<if ($arcologies[0].FSPaternalist > 0)>>
 			Society @@.green;strongly approves@@ of $slaves[_i].slaveName being restored to sanity, which advances ideals about enlightened slave ownership.
@@ -253,7 +253,7 @@
 			<<set $slaves[_i].devotion += 3, $slaves[_i].trust += 3>>
 		<<else>>
 			<<if $Attendant.fetish == "pregnancy">>
-			She can't help but pester $slaves[_i].slaveName with questions about her pregnancy, limiting her ability to truly relax. 
+			She can't help but pester $slaves[_i].slaveName with questions about her pregnancy, limiting her ability to truly relax.
 			<<set $slaves[_i].devotion += 1, $slaves[_i].trust += 1>>
 			<<else>>
 			She does her best to encourage $slaves[_i].slaveName's fertilization by performing any fertility boosting actions she can.
diff --git a/src/uncategorized/surgeryDegradation.tw b/src/uncategorized/surgeryDegradation.tw
index b85767bfb222f6916a633979400c37a26ab5c44f..dfdc3ace9b866b8d8bd545c6a1973828932fcf11 100644
--- a/src/uncategorized/surgeryDegradation.tw
+++ b/src/uncategorized/surgeryDegradation.tw
@@ -2,6 +2,13 @@
 
 <<set $nextButton = "Continue", $nextLink = "Remote Surgery">>
 
+/* disallow surgery for slaves on certain assignments */
+<<switch $activeSlave.assignment>>
+	<<case "be your agent" "live with your agent">>
+		@@.red;You must retrieve $activeSlave.slaveName from her assignment before performing surgery on her.@@
+		<<goto $nextLink>>
+<</switch>>
+
 <<if $activeSlave.dick == 0>>
 	<<if $activeSlave.vagina == -1>>
 			<<set $activeSlave.clitPiercing = 0>>
@@ -512,9 +519,7 @@ As the remote surgery's long recovery cycle completes,
 	She notices almost immediately that the soreness that used to tell her she needed to be milked has gone. She bounces her breasts idly; it looks like she doesn't know what to think about having her lactation dry up. As with all surgery @@.red;her health has been slightly affected.@@
 	<<if $activeSlave.assignment == "get milked">>
 		@@.yellow;Her assignment has defaulted to resting.@@
-		<<set $activeSlave.assignment = "rest">>
-		<<set $activeSlave.assignmentVisible = 1>>
-		<<set $activeSlave.choosesOwnAssignment = 0>>
+		<<removeJob $activeSlave $activeSlave.assignment>>
 	<</if>>
 
 <<case "ejaculation">>
@@ -524,11 +529,11 @@ As the remote surgery's long recovery cycle completes,
 	She can only feel a nondescript soreness in her lower belly. She doesn't understand what was done to her and as such, doesn't know what to think. She'll realize later when she ejaculates roughly twenty percent less semen than unusual. As with all surgery @@.red;her health has been affected.@@
 
 <<case "scarRemov">>
-Even though removing scars is a trivial process, @@.red;her health has been slightly affected@@. When she exits the room, she feels that most of her skin is numb, and she is @@.hotpink;happy@@ when she finds her scars have been removed.
-<<set $activeSlave.devotion += 2>>
+	Even though removing scars is a trivial process, @@.red;her health has been slightly affected@@. When she exits the room, she feels that most of her skin is numb, and she is @@.hotpink;happy@@ when she finds her scars have been removed.
+	<<set $activeSlave.devotion += 2>>
 
 <<case "scarFear">>
-Even though creating an artificial scar is a trivial process, @@.red;her health has been slightly affected@@. When she exits the room, she feels that her face is numb, 
+	Even though creating an artificial scar is a trivial process, @@.red;her health has been slightly affected@@. When she exits the room, she feels that her face is numb, 
 	<<if $activeSlave.ID == $Bodyguard.ID>>
 		<<if canSee($activeSlave)>>throwing a glance at the mirror, she frightens herself<<else>> upon hearing of her new scar<</if>>, but is @@.hotpink;happier@@ with her new look and @@.mediumaquamarine;more confident@@ that she's the girl for the job.
 		<<set $activeSlave.devotion += 5>>
@@ -544,7 +549,7 @@ Even though creating an artificial scar is a trivial process, @@.red;her health
 	<</if>>
 
 <<case "scarExo">>
-Even though creating an artificial scar is a trivial process, @@.red;her health has been slightly affected@@. When she exits the room, she feels that her face is numb, 
+	Even though creating an artificial scar is a trivial process, @@.red;her health has been slightly affected@@. When she exits the room, she feels that her face is numb, 
 	<<if $activeSlave.devotion > 50>>
 		she <<if canSee($activeSlave)>>throws a glance at the mirror<<else>>listens closely to your description<</if>>, and seems to be @@.hotpink;in awe@@ of how much her face has been beautified by a small scar.
 		<<set $activeSlave.devotion += 5>>
@@ -1283,7 +1288,7 @@ Even though creating an artificial scar is a trivial process, @@.red;her health
 		she's shocked by the astounding volume of her<<if $activeSlave.dick == 0>> squirting female<</if>> ejaculation, since her new organ is of course hooked into her urethra and does its duty whenever she climaxes<<if $activeSlave.balls == 0>> despite her lack of testicles to add actual semen to her copious emissions<</if>>.
 		<<if ($activeSlave.fetishKnown == 1) && ($activeSlave.fetish == "buttslut")>>
 			She was already an anal slut, but she can now experience anal pleasure along an entirely new dimension. She's @@.hotpink;extremely grateful,@@ and @@.lightsalmon;a more eager buttslut than ever.@@
-			<<set $activeSlave.devotion += 5, $activeSlave.fetishStrength = Math.clamp(activeSlave.fetishStrength+20,0,100)>>
+			<<set $activeSlave.devotion += 5, $activeSlave.fetishStrength = Math.clamp($activeSlave.fetishStrength+20,0,100)>>
 		<<else>>
 			As a sex slave, she has of course heard of the pleasure of prostate stimulation,<<if $activeSlave.dick != 0>> not to mention having once had one herself,<</if>> and she's @@.hotpink;duly grateful@@ that you've altered her in a way that will make sexual duties more enjoyable.
 		<</if>>
diff --git a/src/uncategorized/wardenessSelect.tw b/src/uncategorized/wardenessSelect.tw
index 7241d0aadc30dfd87c0b17fae1bdbb09f1dcc899..263c24f8d50d8ce43734306d31ea7d013e07e46a 100644
--- a/src/uncategorized/wardenessSelect.tw
+++ b/src/uncategorized/wardenessSelect.tw
@@ -3,7 +3,7 @@
 <<set $nextButton = "Back", $nextLink = "Cellblock", $showEncyclopedia = 1, $encyclopedia = "Wardeness">>
 
 <<if ($Wardeness != 0)>>
-	''__@@.pink;$slaves[_i].slaveName@@__'' is serving as your Wardeness.<br><br>She will help break your prisoners.
+	''__@@.pink;$Wardeness.slaveName@@__'' is serving as your Wardeness.<br><br>She will help break your prisoners.
 <<else>>
 	You have not selected a Wardeness.
 <</if>>
diff --git a/src/utility/assignWidgets.tw b/src/utility/assignWidgets.tw
index a027c749be822f52a6f6129f1299c58cd58ec9e5..1d9fd0c4ea67aae6ca8f7f210fe7a8a7d21fb084 100644
--- a/src/utility/assignWidgets.tw
+++ b/src/utility/assignWidgets.tw
@@ -28,33 +28,33 @@
 /% use .toLowerCase() to get rid of a few dupe conditions. %/
 <<switch $args[1].toLowerCase()>>
 <<case "clinic" "get treatment in the clinic">>
-	<<set $args[0].assignment = "get treatment in the clinic", $args[0].assignmentVisible = 0, $clinicSlaves++, $CliniciIDs.push({ID: _wID, Index: _wi})>>
+	<<set $args[0].assignment = "get treatment in the clinic",  $args[0].assignmentVisible = 0, $clinicSlaves++, $CliniciIDs.push({ID: _wID, Index: _wi})>>
 <<case "schoolroom" "learn in the schoolroom">>
-	<<set $args[0].assignment = "learn in the schoolroom", $args[0].assignmentVisible = 0, $schoolroomSlaves++, $SchlRiIDs.push({ID: _wID, Index: _wi})>>
+	<<set $args[0].assignment = "learn in the schoolroom",      $args[0].assignmentVisible = 0, $schoolroomSlaves++, $SchlRiIDs.push({ID: _wID, Index: _wi})>>
 <<case "spa" "rest in the spa">>
-	<<set $args[0].assignment = "rest in the spa", $args[0].assignmentVisible = 0, $spaSlaves++, $SpaiIDs.push({ID: _wID, Index: _wi})>>
+	<<set $args[0].assignment = "rest in the spa",              $args[0].assignmentVisible = 0, $spaSlaves++, $SpaiIDs.push({ID: _wID, Index: _wi})>>
 <<case "cellblock" "be confined in the cellblock">>
 	<<set $args[0].assignment = "be confined in the cellblock", $args[0].assignmentVisible = 0, $cellblockSlaves++, $CellBiIDs.push({ID: _wID, Index: _wi})>>
 <<case "arcade" "be confined in the arcade">>
-	<<set $args[0].assignment = "be confined in the arcade", $args[0].assignmentVisible = 0, $arcadeSlaves++, $ArcadeiIDs.push({ID: _wID, Index: _wi})>>
+	<<set $args[0].assignment = "be confined in the arcade",    $args[0].assignmentVisible = 0, $arcadeSlaves++, $ArcadeiIDs.push({ID: _wID, Index: _wi})>>
 <<case "brothel" "work in the brothel">>
-	<<set $args[0].assignment = "work in the brothel", $args[0].assignmentVisible = 0, $brothelSlaves++, $BrothiIDs.push({ID: _wID, Index: _wi})>>
+	<<set $args[0].assignment = "work in the brothel",          $args[0].assignmentVisible = 0, $brothelSlaves++, $BrothiIDs.push({ID: _wID, Index: _wi})>>
 <<case "club" "serve in the club">>
-	<<set $args[0].assignment = "serve in the club", $args[0].assignmentVisible = 0, $clubSlaves++, $ClubiIDs.push({ID: _wID, Index: _wi})>>
+	<<set $args[0].assignment = "serve in the club",            $args[0].assignmentVisible = 0, $clubSlaves++, $ClubiIDs.push({ID: _wID, Index: _wi})>>
 <<case "dairy" "work in the dairy">>
-	<<set $args[0].assignment = "work in the dairy", $args[0].assignmentVisible = 0, $dairySlaves++, $DairyiIDs.push({ID: _wID, Index: _wi})>>
+	<<set $args[0].assignment = "work in the dairy",            $args[0].assignmentVisible = 0, $dairySlaves++, $DairyiIDs.push({ID: _wID, Index: _wi})>>
 <<case "hgsuite" "head girl suite" "live with your head girl">>
-	<<set $args[0].assignment = "live with your Head Girl", $args[0].assignmentVisible = 0, $HGSuiteSlaves++, $HGSuiteiIDs.push({ID: _wID, Index: _wi})>>
+	<<set $args[0].assignment = "live with your Head Girl",     $args[0].assignmentVisible = 0, $HGSuiteSlaves++, $HGSuiteiIDs.push({ID: _wID, Index: _wi})>>
 <<case "servantsquarters" "servants' quarters" "work as a servant">>
-	<<set $args[0].assignment = "work as a servant", $args[0].assignmentVisible = 0, $servantsQuartersSlaves++, $ServQiIDs.push({ID: _wID, Index: _wi})>>
+	<<set $args[0].assignment = "work as a servant",            $args[0].assignmentVisible = 0, $servantsQuartersSlaves++, $ServQiIDs.push({ID: _wID, Index: _wi})>>
 <<case "mastersuite" "master suite" "serve in the master suite">>
-	<<set $args[0].assignment = "serve in the master suite", $args[0].assignmentVisible = 0, $masterSuiteSlaves++, $MastSiIDs.push({ID: _wID, Index: _wi})>>
+	<<set $args[0].assignment = "serve in the master suite",    $args[0].assignmentVisible = 0, $masterSuiteSlaves++, $MastSiIDs.push({ID: _wID, Index: _wi})>>
 <<case "be your agent" "live with your agent">>
-	<<set $args[0].assignment = $args[1], $args[0].assignmentVisible = 0>>     /* removeJob already set choosesOwnAssignment = 0 */
+	<<set $args[0].assignment = $args[1],                       $args[0].assignmentVisible = 0>>     /* removeJob already set choosesOwnAssignment = 0 */
 <<case "choose her own job">>
-	<<set $args[0].assignment = $args[1], $args[0].choosesOwnAssignment = 1>>  /* removeJob already set assignmentVisible = 1 */
+	<<set $args[0].assignment = $args[1],                       $args[0].choosesOwnAssignment = 1>>  /* removeJob already set assignmentVisible = 1 */
 <<default>>
-	<<set $args[0].assignment = $args[1]>> /* removeJob already set assignmentVisible = 1 and choosesOwnAssignment = 0 */
+	<<set $args[0].assignment = $args[1]>>                      /* removeJob already set assignmentVisible = 1 and choosesOwnAssignment = 0 */
 <</switch>>
 
 /% Stop creating Starving/overweight deaths?, Endless drug supply etc. %/
diff --git a/src/utility/miscWidgets.tw b/src/utility/miscWidgets.tw
index ef0b7b3f92f771119559525626ffdaf0f678a05b..6387a0dd26f72321aeadbc9293a9595d6e39cc3f 100644
--- a/src/utility/miscWidgets.tw
+++ b/src/utility/miscWidgets.tw
@@ -1779,9 +1779,6 @@ This experience
 		| <<link "Dick">><<set $activeSlave.toyHole = "dick">><<replace "#hole">>$activeSlave.toyHole<</replace>><</link>>
 		<</if>>
 		| <<link "No Preference">><<set $activeSlave.toyHole = "all her holes">><<replace "#hole">>$activeSlave.toyHole<</replace>><</link>>
-		
-		<br>
-		
 	<</if>>
 <</replace>>
 
diff --git a/src/utility/raWidgets.tw b/src/utility/raWidgets.tw
index f9ca23d60e47c6c6aef147d69f12886d29e492eb..6bbe2ba0117670ebde5697bb7dda5dedc128731d 100644
--- a/src/utility/raWidgets.tw
+++ b/src/utility/raWidgets.tw
@@ -6,125 +6,134 @@
 <<widget "RAChangeActivation">>
 
 <<replace #activation>>
-__($currentRule.activation):__
-<br>
-<<if $currentRule.activation == "custom" >>
-	<<textarea "$currentRule.customActivationText" $currentRule.customActivationText>>
-	<<link "Save activation">>
-	<<RAChangeSave>>
-	<<RAChangeApply>>
-	<</link>>
-<<elseif ($currentRule.activation != "none") && ($currentRule.activation != "always")>>
-<span id="lower">
-<<if ($currentRule.thresholdLower == "none")>>
-(no lower limit)
-<<else>>
-<<if $currentRule.eqLower>>
-When ''$currentRule.activation'' is
-<<textbox "$currentRule.thresholdLower" $currentRule.thresholdLower>> ''or more''
-<<else>>
-When ''$currentRule.activation'' is ''more than''
-<<textbox "$currentRule.thresholdLower" $currentRule.thresholdLower>>
-<</if>>
-<</if>>
-</span>
-      <<link ">">>
-<<set $currentRule.eqLower = false>>
-<<replace "#lower">>
-When ''$currentRule.activation'' is ''more than''
-<<textbox "$currentRule.thresholdLower" $currentRule.thresholdLower>>
-<</replace>>
-<</link>>
- |
-<<link ">=">>
-<<set $currentRule.eqLower = true>>
-<<replace "#lower">>
-When ''$currentRule.activation'' is
-<<textbox "$currentRule.thresholdLower" $currentRule.thresholdLower>> ''or more''
-<</replace>>
-<</link>>
- |
-<<link "No lower limit">>
-<<set $currentRule.thresholdLower = "none">>
-<<replace "#lower">>
-(no lower limit)
-<</replace>>
-<</link>>
-<br>and<br>
-<span id="upper">
-<<if ($currentRule.thresholdUpper == "none")>>
-(no upper limit)
-<<else>>
-<<if $currentRule.eqUpper>>
-When ''$currentRule.activation'' is
-<<textbox "$currentRule.thresholdUpper" $currentRule.thresholdUpper>> ''or less''
-<<else>>
-When ''$currentRule.activation'' is ''less than''
-<<textbox "$currentRule.thresholdUpper" $currentRule.thresholdUpper>>
-<</if>>
-<</if>>
-</span>
-      <<link "<">>
-<<set $currentRule.eqUpper = false>>
-<<replace "#upper">>
-When ''$currentRule.activation'' is ''less than''
-<<textbox "$currentRule.thresholdUpper" $currentRule.thresholdUpper>>
-<</replace>>
-<</link>>
- |
-<<link "<=">>
-<<set $currentRule.eqUpper = true>>
-<<replace "#upper">>
-When ''$currentRule.activation'' is
-<<textbox "$currentRule.thresholdUpper" $currentRule.thresholdUpper>> ''or less''
-<</replace>>
-<</link>>
-|
-<<link "No upper limit">>
-<<set $currentRule.thresholdUpper = "none">>
-<<replace "#upper">>
-(no upper limit)
-<</replace>>
-<</link>>
-<<if ($currentRule.thresholdLower == "none") && ( $currentRule.thresholdUpper == "none")>>
-	<<set $currentRule.activation = "always">>
-<<elseif ($currentRule.thresholdLower != "none") && ( $currentRule.thresholdUpper != "none")>>
-	<<if (def $currentRule.thresholdLower && $currentRule.thresholdLower > $currentRule.thresholdUpper)>>
-	<<set $currentRule.thresholdLower = $currentRule.thresholdUpper>>
-	<</if>>
-	<<if (def $currentRule.thresholdUpper && $currentRule.thresholdUpper < $currentRule.thresholdLower)>>
-	<<set $currentRule.thresholdUpper = $currentRule.thresholdLower>>
+	<<print "($currentRule.activation):">>
+	<br>
+	<<if $currentRule.activation == "custom" >>
+		<<textarea "$currentRule.customActivationText" $currentRule.customActivationText>>
+		<<link "Save activation">>
+			<<replace #customsave>>
+				//Activated save link below - remember to save your changes!//
+			<</replace>>
+			<<RAChangeSave>>
+			<<RAChangeApply>>
+		<</link>>
+		<span id="customsave"></span>
+	<<elseif ($currentRule.activation != "none") && ($currentRule.activation != "always")>>
+		<span id="lower">
+			<<if ($currentRule.thresholdLower == "none")>>
+			(no lower limit)
+			<<else>>
+				<<if $currentRule.eqLower>>
+					When ''$currentRule.activation'' is
+					<<textbox "$currentRule.thresholdLower" $currentRule.thresholdLower>> ''or more''
+				<<else>>
+					When ''$currentRule.activation'' is ''more than''
+					<<textbox "$currentRule.thresholdLower" $currentRule.thresholdLower>>
+				<</if>>
+			<</if>>
+		</span>
+
+		<<link ">">>
+			<<set $currentRule.eqLower = false>>
+			<<replace "#lower">>
+				When ''$currentRule.activation'' is ''more than''
+				<<textbox "$currentRule.thresholdLower" $currentRule.thresholdLower>>
+			<</replace>>
+		<</link>>
+	 |
+		<<link ">=">>
+			<<set $currentRule.eqLower = true>>
+			<<replace "#lower">>
+				When ''$currentRule.activation'' is
+				<<textbox "$currentRule.thresholdLower" $currentRule.thresholdLower>> ''or more''
+			<</replace>>
+		<</link>>
+	 |
+		<<link "No lower limit">>
+			<<set $currentRule.thresholdLower = "none">>
+			<<replace "#lower">>
+				(no lower limit)
+			<</replace>>
+		<</link>>
+
+		<br>and<br>
+
+		<span id="upper">
+			<<if ($currentRule.thresholdUpper == "none")>>
+				(no upper limit)
+			<<else>>
+				<<if $currentRule.eqUpper>>
+					When ''$currentRule.activation'' is
+					<<textbox "$currentRule.thresholdUpper" $currentRule.thresholdUpper>> ''or less''
+				<<else>>
+					When ''$currentRule.activation'' is ''less than''
+					<<textbox "$currentRule.thresholdUpper" $currentRule.thresholdUpper>>
+				<</if>>
+			<</if>>
+		</span>
+
+		<<link "<">>
+			<<set $currentRule.eqUpper = false>>
+			<<replace "#upper">>
+				When ''$currentRule.activation'' is ''less than''
+				<<textbox "$currentRule.thresholdUpper" $currentRule.thresholdUpper>>
+			<</replace>>
+		<</link>>
+	 |
+		<<link "<=">>
+			<<set $currentRule.eqUpper = true>>
+			<<replace "#upper">>
+				When ''$currentRule.activation'' is
+				<<textbox "$currentRule.thresholdUpper" $currentRule.thresholdUpper>> ''or less''
+			<</replace>>
+		<</link>>
+	 |
+		<<link "No upper limit">>
+			<<set $currentRule.thresholdUpper = "none">>
+			<<replace "#upper">>
+				(no upper limit)
+			<</replace>>
+		<</link>>
+
+		<<if ($currentRule.thresholdLower == "none") && ($currentRule.thresholdUpper == "none")>>
+			<<set $currentRule.activation = "always">>
+		<<elseif ($currentRule.thresholdLower != "none") && ($currentRule.thresholdUpper != "none")>>
+			<<if (def $currentRule.thresholdLower && $currentRule.thresholdLower > $currentRule.thresholdUpper)>>
+				<<set $currentRule.thresholdLower = $currentRule.thresholdUpper>>
+			<</if>>
+			<<if (def $currentRule.thresholdUpper && $currentRule.thresholdUpper < $currentRule.thresholdLower)>>
+				<<set $currentRule.thresholdUpper = $currentRule.thresholdLower>>
+			<</if>>
+		<</if>>
 	<</if>>
-<</if>>
-<</if>>
-<<switch $currentRule.activation>>
-<<case "none">>
-''None.''
-<<case "always">>
-''Always.''
-<<case "devotion">>
-<br>@@.darkviolet;Very hateful@@: under -95, @@.darkviolet;Hateful@@: -95 to under -50, @@.mediumorchid;Resistant@@: -50 to under -20,
-<br>@@.yellow;Ambivalent@@: -20 to 20, @@.hotpink;Accepting@@: over 20 to 50, @@.deeppink;Devoted@@: over 50 to 95, @@.magenta;Worshipful@@: over 95
-<<case "trust">>
-<br>@@.goldenrod;Extremely terrified@@: under -95, @@.goldenrod;Terrified@@: -95 to under -50, @@.gold;Frightened@@: -50 to under -20,
-<br>@@.yellow;Fearful@@: -20 to 20, @@.mediumaquamarine;Careful@@: over 40 to 50, @@.mediumseagreen;Trusting@@: 50 to 95, @@.seagreen;Total trust@@: over 95
-<<case "health">>
-<br>@@.red;Death@@: under -100, @@.red;Near death@@: -100 to less than -90, @@.red;Extremely unhealthy@@: -90 to less than -50, @@.red;Unhealthy@@: -50 to less than -20 @@.green;Healthy@@: -20 to 20, @@.green;Very healthy@@: 20 to 50, @@.green;Extremely healthy@@: over 50 to 90, @@.green;Unnaturally healthy@@: over 90
-<<case "sex drive">>
-<br>@@.red;Frigid@@: 20 or under, @@.red;Poor@@: 21 to 40, @@.yellow;Average@@: 41 to 60, @@.green;Powerful@@: 61 to 80, @@.green;Sex addict@@: 81 to 99, @@.green;Nympho@@: 100
-<<case "weight">>
-<br>@@.red;Emaciated@@: under -95, @@.red;Skinny@@: -95 to less than -30, Thin: -30 to less than -10 Average weight: -10 to 10, Plush: over 10 to 30, @@.red;Fat@@: over 30 to 95, @@.red;Overweight@@: over 95
-<<case "lactation">>
-<br>// 0 - none, 1 - natural, 2 - lactation implant. //
-<<case "pregnancy week">>
-<br>// >1 - pregnancy week(s), 0 - not pregnant, -1 - on contraceptives, -2 - barren. //
-<<case "pregnancy foetuses">>
-<br>// Fetus count, rule can be applied only after week 10 of pregnancy. //
-<<case "belly implant volume">>
-<br>// Volume of belly implant in ccs. 0 - none. //
-<<case "custom">>
-<br>// Enter custom condition. //
-<</switch>>
+	<<switch $currentRule.activation>>
+		<<case "none">>
+		''None.''
+		<<case "always">>
+		''Always.''
+		<<case "devotion">>
+		<br>@@.darkviolet;Very hateful@@: under -95, @@.darkviolet;Hateful@@: -95 to under -50, @@.mediumorchid;Resistant@@: -50 to under -20,
+		<br>@@.yellow;Ambivalent@@: -20 to 20, @@.hotpink;Accepting@@: over 20 to 50, @@.deeppink;Devoted@@: over 50 to 95, @@.magenta;Worshipful@@: over 95
+		<<case "trust">>
+		<br>@@.goldenrod;Extremely terrified@@: under -95, @@.goldenrod;Terrified@@: -95 to under -50, @@.gold;Frightened@@: -50 to under -20,
+		<br>@@.yellow;Fearful@@: -20 to 20, @@.mediumaquamarine;Careful@@: over 40 to 50, @@.mediumseagreen;Trusting@@: 50 to 95, @@.seagreen;Total trust@@: over 95
+		<<case "health">>
+		<br>@@.red;Death@@: under -100, @@.red;Near death@@: -100 to less than -90, @@.red;Extremely unhealthy@@: -90 to less than -50, @@.red;Unhealthy@@: -50 to less than -20 @@.green;Healthy@@: -20 to 20, @@.green;Very healthy@@: 20 to 50, @@.green;Extremely healthy@@: over 50 to 90, @@.green;Unnaturally healthy@@: over 90
+		<<case "sex drive">>
+		<br>@@.red;Frigid@@: 20 or under, @@.red;Poor@@: 21 to 40, @@.yellow;Average@@: 41 to 60, @@.green;Powerful@@: 61 to 80, @@.green;Sex addict@@: 81 to 99, @@.green;Nympho@@: 100
+		<<case "weight">>
+		<br>@@.red;Emaciated@@: under -95, @@.red;Skinny@@: -95 to less than -30, Thin: -30 to less than -10 Average weight: -10 to 10, Plush: over 10 to 30, @@.red;Fat@@: over 30 to 95, @@.red;Overweight@@: over 95
+		<<case "lactation">>
+		<br>// 0 - none, 1 - natural, 2 - lactation implant. //
+		<<case "pregnancy week">>
+		<br>// >1 - pregnancy week(s), 0 - not pregnant, -1 - on contraceptives, -2 - barren. //
+		<<case "pregnancy foetuses">>
+		<br>// Fetus count, rule can be applied only after week 10 of pregnancy. //
+		<<case "belly implant volume">>
+		<br>// Volume of belly implant in ccs. 0 - none. //
+		<<case "custom">>
+		<br>// Enter custom condition. //
+	<</switch>>
 <</replace>>
 <</widget>>
 
@@ -133,11 +142,6 @@ When ''$currentRule.activation'' is
 %/
 <<widget "RAChangeApplyAssignment">>
 <<replace #applyassignment>>
-Apply to assignments:
-<br>
-<<if ndef $currentRule.assignment>>
-	<<set $currentRule.assignment = []>>
-<</if>>
 <<set _rest = false>>
 <<set _fucktoy = false>>
 <<set _servant = false>>
@@ -149,52 +153,60 @@ Apply to assignments:
 <<set _gloryhole = false>>
 
 <<for _a = $currentRule.assignment.length; _a >= 0; _a-->>
-<<if $currentRule.assignment[_a] == "rest">>
-	<<set _rest = true>>
-<</if>>
-<<if $currentRule.assignment[_a] == "please you">>
-	<<set _fucktoy = true>>
-<</if>>
-<<if $currentRule.assignment[_a] == "be a servant">>
-	<<set _servant = true>>
-<</if>>
-<<if $currentRule.assignment[_a] == "whore">>
-	<<set _whore = true>>
-<</if>>
-<<if $currentRule.assignment[_a] == "work a glory hole">>
-	<<set _gloryhole = true>>
-<</if>>
-<<if $currentRule.assignment[_a] == "get milked">>
-	<<set _milked = true>>
-<</if>>
-<<if $currentRule.assignment[_a] == "serve the public">>
-	<<set _public = true>>
-<</if>>
-<<if $currentRule.assignment[_a] == "be a subordinate slave">>
-	<<set _subordinate = true>>
-<</if>>
-<<if $currentRule.assignment[_a] == "stay confined">>
-	<<set _confined = true>>
-<</if>>
+	<<if $currentRule.assignment[_a] == "rest">>
+		<<set _rest = true>>
+	<</if>>
+	<<if $currentRule.assignment[_a] == "please you">>
+		<<set _fucktoy = true>>
+	<</if>>
+	<<if $currentRule.assignment[_a] == "be a servant">>
+		<<set _servant = true>>
+	<</if>>
+	<<if $currentRule.assignment[_a] == "whore">>
+		<<set _whore = true>>
+	<</if>>
+	<<if $currentRule.assignment[_a] == "work a glory hole">>
+		<<set _gloryhole = true>>
+	<</if>>
+	<<if $currentRule.assignment[_a] == "get milked">>
+		<<set _milked = true>>
+	<</if>>
+	<<if $currentRule.assignment[_a] == "serve the public">>
+		<<set _public = true>>
+	<</if>>
+	<<if $currentRule.assignment[_a] == "be a subordinate slave">>
+		<<set _subordinate = true>>
+	<</if>>
+	<<if $currentRule.assignment[_a] == "stay confined">>
+		<<set _confined = true>>
+	<</if>>
 <</for>>
 
 <<if _rest || _fucktoy || _servant || _confined || _whore || _public || _milked || _subordinate || _gloryhole>>
+  Apply to assignments:
 	<<link "All">>
 		<<set $currentRule.assignment = []>>
+		<<set $currentRule.excludeAssignment = []>>
+		<<set $currentRule.setAssignment = "none">>
 		<<RAChangeApplyAssignment>>
+		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>> |
 <<else>>
+  @@.gray;Apply to assignments:@@
 	''All'' |
 <</if>>
 
 <<if !_rest>>
 	<<link "Rest">>
 		<<set $currentRule.assignment.push("rest")>>
+		<<set $currentRule.excludeAssignment = []>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
 		<<RAChangeApplyAssignment>>
+		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -211,9 +223,11 @@ Apply to assignments:
 <<if !_fucktoy>>
 	<<link "Fucktoy">>
 		<<set $currentRule.assignment.push("please you")>>
+		<<set $currentRule.excludeAssignment = []>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
 		<<RAChangeApplyAssignment>>
+		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -230,9 +244,11 @@ Apply to assignments:
 <<if !_subordinate>>
 	<<link "Subordinate Slave">>
 		<<set $currentRule.assignment.push("be a subordinate slave")>>
+		<<set $currentRule.excludeAssignment = []>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
 		<<RAChangeApplyAssignment>>
+		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -251,9 +267,11 @@ Apply to assignments:
 <<if !_servant>>
 	<<link "House Servant">>
 		<<set $currentRule.assignment.push("be a servant")>>
+		<<set $currentRule.excludeAssignment = []>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
 		<<RAChangeApplyAssignment>>
+		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -270,9 +288,11 @@ Apply to assignments:
 <<if !_confined>>
 	<<link "Confined">>
 		<<set $currentRule.assignment.push("stay confined")>>
+		<<set $currentRule.excludeAssignment = []>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
 		<<RAChangeApplyAssignment>>
+		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -289,9 +309,11 @@ Apply to assignments:
 <<if !_whore>>
 	<<link "Whore">>
 		<<set $currentRule.assignment.push("whore")>>
+		<<set $currentRule.excludeAssignment = []>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
 		<<RAChangeApplyAssignment>>
+		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -308,9 +330,11 @@ Apply to assignments:
 <<if !_public>>
 	<<link "Public Servant">>
 		<<set $currentRule.assignment.push("serve the public")>>
+		<<set $currentRule.excludeAssignment = []>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
 		<<RAChangeApplyAssignment>>
+		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -327,9 +351,11 @@ Apply to assignments:
 <<if !_milked>>
 	<<link "Milking">>
 		<<set $currentRule.assignment.push("get milked")>>
+		<<set $currentRule.excludeAssignment = []>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
 		<<RAChangeApplyAssignment>>
+		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -346,9 +372,11 @@ Apply to assignments:
 <<if !_gloryhole>>
 	<<link "Gloryhole">>
 		<<set $currentRule.assignment.push("work a glory hole")>>
+		<<set $currentRule.excludeAssignment = []>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
 		<<RAChangeApplyAssignment>>
+		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -368,11 +396,7 @@ Apply to assignments:
 %/
 <<widget "RAChangeExcludeAssignment">>
 <<replace #excludeassignment>>
-Exclude assignments:
 <br>
-<<if ndef $currentRule.excludeAssignment>>
-	<<set $currentRule.excludeAssignment = []>>
-<</if>>
 <<set _rest = false>>
 <<set _fucktoy = false>>
 <<set _servant = false>>
@@ -412,21 +436,28 @@ Exclude assignments:
 <</if>>
 <</for>>
 <<if _rest || _fucktoy || _servant || _confined || _whore || _public || _milked || _subordinate || _gloryhole>>
+  Include all assignments except:
 	<<link "None">>
 		<<set $currentRule.excludeAssignment = []>>
 		<<RAChangeExcludeAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>> |
+<<elseif $currentRule.assignment.length > 0>>
+  @@.gray;Exclude assignments:@@
+	''None'' |
 <<else>>
+  Excluded assignments:
 	''None'' |
 <</if>>
 <<if !_rest>>
 	<<link "Rest">>
+		<<set $currentRule.assignment = []>>
 		<<set $currentRule.excludeAssignment.push("rest")>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
+		<<RAChangeApplyAssignment>>
 		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -442,10 +473,12 @@ Exclude assignments:
 |
 <<if !_fucktoy>>
 	<<link "Fucktoy">>
+		<<set $currentRule.assignment = []>>
 		<<set $currentRule.excludeAssignment.push("please you")>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
+		<<RAChangeApplyAssignment>>
 		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -461,10 +494,12 @@ Exclude assignments:
 |
 <<if !_subordinate>>
 	<<link "Subordinate Slave">>
+		<<set $currentRule.assignment = []>>
 		<<set $currentRule.excludeAssignment.push("be a subordinate slave")>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
+		<<RAChangeApplyAssignment>>
 		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -481,10 +516,12 @@ Exclude assignments:
 |
 <<if !_servant>>
 	<<link "House Servant">>
+		<<set $currentRule.assignment = []>>
 		<<set $currentRule.excludeAssignment.push("be a servant")>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
+		<<RAChangeApplyAssignment>>
 		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -500,10 +537,12 @@ Exclude assignments:
 |
 <<if !_confined>>
 	<<link "Confined">>
+		<<set $currentRule.assignment = []>>
 		<<set $currentRule.excludeAssignment.push("stay confined")>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
+		<<RAChangeApplyAssignment>>
 		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -519,10 +558,12 @@ Exclude assignments:
 |
 <<if !_whore>>
 	<<link "Whore">>
+		<<set $currentRule.assignment = []>>
 		<<set $currentRule.excludeAssignment.push("whore")>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
+		<<RAChangeApplyAssignment>>
 		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -538,10 +579,12 @@ Exclude assignments:
 |
 <<if !_public>>
 	<<link "Public Servant">>
+		<<set $currentRule.assignment = []>>
 		<<set $currentRule.excludeAssignment.push("serve the public")>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
+		<<RAChangeApplyAssignment>>
 		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -557,10 +600,12 @@ Exclude assignments:
 |
 <<if !_milked>>
 	<<link "Milking">>
+		<<set $currentRule.assignment = []>>
 		<<set $currentRule.excludeAssignment.push("get milked")>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
+		<<RAChangeApplyAssignment>>
 		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -576,10 +621,12 @@ Exclude assignments:
 |
 <<if !_gloryhole>>
 	<<link "Gloryhole">>
+		<<set $currentRule.assignment = []>>
 		<<set $currentRule.excludeAssignment.push("work a glory hole")>>
 		<<set $currentRule.setAssignment = "none">>
-		<<RAChangeSetAssignment>>
+		<<RAChangeApplyAssignment>>
 		<<RAChangeExcludeAssignment>>
+		<<RAChangeSetAssignment>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
@@ -603,25 +650,33 @@ Exclude assignments:
 <<replace #applyfacility>>
 <<if ($HGSuite > 0) || ($brothel > 0) || ($club > 0) || ($arcade > 0) || ($dairy > 0) || ($servantsQuarters > 0) || ($masterSuite > 0) || ($schoolroom > 0) || ($spa > 0) || ($clinic > 0) || ($cellblock > 0)>>
 <br><br>
-Apply to facilities:
-<br>
-<<if (_facility.length > 0)>>
-	<<link "All">>
-		<<set _facility = []>>
+<<if ($currentRule.facility.length > 0)>>
+  Apply to facilities:
+	<<link "None">>
+		<<set $currentRule.facility = []>>
+		<<set $currentRule.excludeFacility = []>>
+		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyFacility>>
+		<<RAChangeExcludeFacility>>
+		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
 <<else>>
+  @@.gray;Apply to facilities:@@
 	''All''
 <</if>>
 <<if ($HGSuite > 0)>>
 |
-<<if !ruleFacility(_facility,"hgsuite")>>
+<<if !ruleFacility($currentRule.facility,"hgsuite")>>
 	<<link $HGSuiteNameCaps>>
-		<<set _facility.push("hgsuite")>>
+		<<set $currentRule.facility.push("hgsuite")>>
+		<<set $currentRule.excludeFacility = []>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyFacility>>
+		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -629,7 +684,7 @@ Apply to facilities:
 <<else>>
 	''$HGSuiteNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_facility, "hgsuite")>>
+		<<set removeFromArray($currentRule.facility, "hgsuite")>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -638,11 +693,14 @@ Apply to facilities:
 <</if>>
 <<if ($brothel > 0)>>
 |
-<<if !ruleFacility(_facility,"brothel")>>
+<<if !ruleFacility($currentRule.facility,"brothel")>>
 	<<link $brothelNameCaps>>
-		<<set _facility.push("brothel")>>
+		<<set $currentRule.facility.push("brothel")>>
+		<<set $currentRule.excludeFacility = []>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyFacility>>
+		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -650,7 +708,7 @@ Apply to facilities:
 <<else>>
 	''$brothelNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_facility, "brothel")>>
+		<<set removeFromArray($currentRule.facility, "brothel")>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -659,11 +717,14 @@ Apply to facilities:
 <</if>>
 <<if ($club > 0)>>
 |
-<<if !ruleFacility(_facility,"club")>>
+<<if !ruleFacility($currentRule.facility,"club")>>
 	<<link $clubNameCaps>>
-		<<set _facility.push("club")>>
+		<<set $currentRule.facility.push("club")>>
+		<<set $currentRule.excludeFacility = []>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyFacility>>
+		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -671,7 +732,7 @@ Apply to facilities:
 <<else>>
 	''$clubNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_facility, "club")>>
+		<<set removeFromArray($currentRule.facility, "club")>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -680,11 +741,14 @@ Apply to facilities:
 <</if>>
 <<if ($arcade > 0)>>
 |
-<<if !ruleFacility(_facility,"arcade")>>
+<<if !ruleFacility($currentRule.facility,"arcade")>>
 	<<link $arcadeNameCaps>>
-		<<set _facility.push("arcade")>>
+		<<set $currentRule.facility.push("arcade")>>
+		<<set $currentRule.excludeFacility = []>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyFacility>>
+		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -692,7 +756,7 @@ Apply to facilities:
 <<else>>
 	''$arcadeNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_facility, "arcade")>>
+		<<set removeFromArray($currentRule.facility, "arcade")>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -701,11 +765,14 @@ Apply to facilities:
 <</if>>
 <<if ($dairy > 0)>>
 |
-<<if !ruleFacility(_facility,"dairy")>>
+<<if !ruleFacility($currentRule.facility,"dairy")>>
 	<<link $dairyNameCaps>>
-		<<set _facility.push("dairy")>>
+		<<set $currentRule.facility.push("dairy")>>
+		<<set $currentRule.excludeFacility = []>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyFacility>>
+		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -713,7 +780,7 @@ Apply to facilities:
 <<else>>
 	''$dairyNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_facility, "dairy")>>
+		<<set removeFromArray($currentRule.facility, "dairy")>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -722,11 +789,14 @@ Apply to facilities:
 <</if>>
 <<if ($servantsQuarters > 0)>>
 |
-<<if !ruleFacility(_facility,"servantsquarters")>>
+<<if !ruleFacility($currentRule.facility,"servantsquarters")>>
 	<<link $servantsQuartersNameCaps>>
-		<<set _facility.push("servantsquarters")>>
+		<<set $currentRule.facility.push("servantsquarters")>>
+		<<set $currentRule.excludeFacility = []>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyFacility>>
+		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -734,7 +804,7 @@ Apply to facilities:
 <<else>>
 	''$servantsQuartersNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_facility, "servantsquarters")>>
+		<<set removeFromArray($currentRule.facility, "servantsquarters")>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -743,11 +813,14 @@ Apply to facilities:
 <</if>>
 <<if ($masterSuite > 0)>>
 |
-<<if !ruleFacility(_facility,"mastersuite")>>
+<<if !ruleFacility($currentRule.facility,"mastersuite")>>
 	<<link $masterSuiteNameCaps>>
-		<<set _facility.push("mastersuite")>>
+		<<set $currentRule.facility.push("mastersuite")>>
+		<<set $currentRule.excludeFacility = []>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyFacility>>
+		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -755,7 +828,7 @@ Apply to facilities:
 <<else>>
 	''$masterSuiteNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_facility, "mastersuite")>>
+		<<set removeFromArray($currentRule.facility, "mastersuite")>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -764,11 +837,14 @@ Apply to facilities:
 <</if>>
 <<if ($schoolroom > 0)>>
 |
-<<if !ruleFacility(_facility,"schoolroom")>>
+<<if !ruleFacility($currentRule.facility,"schoolroom")>>
 	<<link $schoolroomNameCaps>>
-		<<set _facility.push("schoolroom")>>
+		<<set $currentRule.facility.push("schoolroom")>>
+		<<set $currentRule.excludeFacility = []>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyFacility>>
+		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -776,7 +852,7 @@ Apply to facilities:
 <<else>>
 	''$schoolroomNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_facility, "schoolroom")>>
+		<<set removeFromArray($currentRule.facility, "schoolroom")>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -785,11 +861,14 @@ Apply to facilities:
 <</if>>
 <<if ($spa > 0)>>
 |
-<<if !ruleFacility(_facility,"spa")>>
+<<if !ruleFacility($currentRule.facility,"spa")>>
 	<<link $spaNameCaps>>
-		<<set _facility.push("spa")>>
+		<<set $currentRule.facility.push("spa")>>
+		<<set $currentRule.excludeFacility = []>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyFacility>>
+		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -797,7 +876,7 @@ Apply to facilities:
 <<else>>
 	''$spaNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_facility, "spa")>>
+		<<set removeFromArray($currentRule.facility, "spa")>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -806,11 +885,14 @@ Apply to facilities:
 <</if>>
 <<if ($clinic > 0)>>
 |
-<<if !ruleFacility(_facility,"clinic")>>
+<<if !ruleFacility($currentRule.facility,"clinic")>>
 	<<link $clinicNameCaps>>
-		<<set _facility.push("clinic")>>
+		<<set $currentRule.facility.push("clinic")>>
+		<<set $currentRule.excludeFacility = []>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyFacility>>
+		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -818,7 +900,7 @@ Apply to facilities:
 <<else>>
 ''$clinicNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_facility, "clinic")>>
+		<<set removeFromArray($currentRule.facility, "clinic")>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -827,11 +909,14 @@ Apply to facilities:
 <</if>>
 <<if ($cellblock > 0)>>
 |
-<<if !ruleFacility(_facility,"cellblock")>>
+<<if !ruleFacility($currentRule.facility,"cellblock")>>
 	<<link $cellblockNameCaps>>
-		<<set _facility.push("cellblock")>>
+		<<set $currentRule.facility.push("cellblock")>>
+		<<set $currentRule.excludeFacility = []>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyFacility>>
+		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -839,7 +924,7 @@ Apply to facilities:
 <<else>>
 	''$cellblockNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_facility, "cellblock")>>
+		<<set removeFromArray($currentRule.facility, "cellblock")>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -847,27 +932,6 @@ Apply to facilities:
 <</if>>
 <</if>>
 <</if>>
-<<if (def _facility) && (_facility.length > 0)>>
-<br>
-  Exclude special slaves:
-<<if $currentRule.excludeSpecialSlaves>>
-	''True'' |
-	<<link False>>
-		<<set $currentRule.excludeSpecialSlaves = false>>
-		<<RAChangeApplyFacility>>
-		<<RAChangeSave>>
-		<<RAChangeApply>>
-	<</link>>
-<<else>>
-	''False'' |
-	<<link True>>
-		<<set $currentRule.excludeSpecialSlaves = true>>
-		<<RAChangeApplyFacility>>
-		<<RAChangeSave>>
-		<<RAChangeApply>>
-	<</link>>
-<</if>>
-<</if>>
 <</replace>>
 <</widget>>
 /%
@@ -877,24 +941,31 @@ Apply to facilities:
 <<replace #excludefacility>>
 <<if ($HGSuite > 0) || ($brothel > 0) || ($club > 0) || ($arcade > 0) || ($dairy > 0) || ($servantsQuarters > 0) || ($masterSuite > 0) || ($schoolroom > 0) || ($spa > 0) || ($clinic > 0) || ($cellblock > 0)>>
 <br>
-Exclude facilities:
-<br>
-<<if (_excludeFacility.length > 0)>>
+<<if ($currentRule.excludeFacility.length > 0)>>
+  Applying to all facilities except:
 	<<link "None">>
-		<<set _excludeFacility = []>>
+		<<set $currentRule.excludeFacility = []>>
+		<<RAChangeApplyFacility>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
+<<elseif $currentRule.facility.length > 0>>
+  @@.gray;Exclude facilities:@@
+	''None''
 <<else>>
+  Excluded facilities:
 	''None''
 <</if>>
 <<if ($HGSuite > 0)>>
 |
-<<if !ruleFacility(_excludeFacility,"hgsuite")>>
+<<if !ruleFacility($currentRule.excludeFacility,"hgsuite")>>
 	<<link $HGSuiteNameCaps>>
-		<<set _excludeFacility.push("hgsuite")>>
+		<<set $currentRule.facility = []>>
+		<<set $currentRule.excludeFacility.push("hgsuite")>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
+		<<RAChangeApplyFacility>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
@@ -903,7 +974,7 @@ Exclude facilities:
 <<else>>
 	''$HGSuiteNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_excludeFacility, "hgsuite")>>
+		<<set removeFromArray($currentRule.excludeFacility, "hgsuite")>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -912,10 +983,13 @@ Exclude facilities:
 <</if>>
 <<if ($brothel > 0)>>
 |
-<<if !ruleFacility(_excludeFacility,"brothel")>>
+<<if !ruleFacility($currentRule.excludeFacility,"brothel")>>
 	<<link $brothelNameCaps>>
-		<<set _excludeFacility.push("brothel")>>
+		<<set $currentRule.facility = []>>
+		<<set $currentRule.excludeFacility.push("brothel")>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
+		<<RAChangeApplyFacility>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
@@ -924,7 +998,7 @@ Exclude facilities:
 <<else>>
 	''$brothelNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_excludeFacility, "brothel")>>
+		<<set removeFromArray($currentRule.excludeFacility, "brothel")>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -933,10 +1007,13 @@ Exclude facilities:
 <</if>>
 <<if ($club > 0)>>
 |
-<<if !ruleFacility(_excludeFacility,"club")>>
+<<if !ruleFacility($currentRule.excludeFacility,"club")>>
 	<<link $clubNameCaps>>
-		<<set _excludeFacility.push("club")>>
+		<<set $currentRule.facility = []>>
+		<<set $currentRule.excludeFacility.push("club")>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
+		<<RAChangeApplyFacility>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
@@ -945,7 +1022,7 @@ Exclude facilities:
 <<else>>
 	''$clubNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_excludeFacility, "club")>>
+		<<set removeFromArray($currentRule.excludeFacility, "club")>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -954,10 +1031,13 @@ Exclude facilities:
 <</if>>
 <<if ($arcade > 0)>>
 |
-<<if !ruleFacility(_excludeFacility,"arcade")>>
+<<if !ruleFacility($currentRule.excludeFacility,"arcade")>>
 	<<link $arcadeNameCaps>>
-		<<set _excludeFacility.push("arcade")>>
+		<<set $currentRule.facility = []>>
+		<<set $currentRule.excludeFacility.push("arcade")>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
+		<<RAChangeApplyFacility>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
@@ -966,7 +1046,7 @@ Exclude facilities:
 <<else>>
 	''$arcadeNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_excludeFacility, "arcade")>>
+		<<set removeFromArray($currentRule.excludeFacility, "arcade")>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -975,10 +1055,13 @@ Exclude facilities:
 <</if>>
 <<if ($dairy > 0)>>
 |
-<<if !ruleFacility(_excludeFacility,"dairy")>>
+<<if !ruleFacility($currentRule.excludeFacility,"dairy")>>
 	<<link $dairyNameCaps>>
-		<<set _excludeFacility.push("dairy")>>
+		<<set $currentRule.facility = []>>
+		<<set $currentRule.excludeFacility.push("dairy")>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
+		<<RAChangeApplyFacility>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
@@ -987,7 +1070,7 @@ Exclude facilities:
 <<else>>
 	''$dairyNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_excludeFacility, "dairy")>>
+		<<set removeFromArray($currentRule.excludeFacility, "dairy")>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -996,10 +1079,13 @@ Exclude facilities:
 <</if>>
 <<if ($servantsQuarters > 0)>>
 |
-<<if !ruleFacility(_excludeFacility,"servantsquarters")>>
+<<if !ruleFacility($currentRule.excludeFacility,"servantsquarters")>>
 	<<link $servantsQuartersNameCaps>>
-		<<set _excludeFacility.push("servantsquarters")>>
+		<<set $currentRule.facility = []>>
+		<<set $currentRule.excludeFacility.push("servantsquarters")>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
+		<<RAChangeApplyFacility>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
@@ -1008,7 +1094,7 @@ Exclude facilities:
 <<else>>
 	''$servantsQuartersNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_excludeFacility, "servantsquarters")>>
+		<<set removeFromArray($currentRule.excludeFacility, "servantsquarters")>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -1017,10 +1103,13 @@ Exclude facilities:
 <</if>>
 <<if ($masterSuite > 0)>>
 |
-<<if !ruleFacility(_excludeFacility,"mastersuite")>>
+<<if !ruleFacility($currentRule.excludeFacility,"mastersuite")>>
 	<<link $masterSuiteNameCaps>>
-		<<set _excludeFacility.push("mastersuite")>>
+		<<set $currentRule.facility = []>>
+		<<set $currentRule.excludeFacility.push("mastersuite")>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
+		<<RAChangeApplyFacility>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
@@ -1029,7 +1118,7 @@ Exclude facilities:
 <<else>>
 	''$masterSuiteNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_excludeFacility, "mastersuite")>>
+		<<set removeFromArray($currentRule.excludeFacility, "mastersuite")>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -1038,10 +1127,13 @@ Exclude facilities:
 <</if>>
 <<if ($schoolroom > 0)>>
 |
-<<if !ruleFacility(_excludeFacility,"schoolroom")>>
+<<if !ruleFacility($currentRule.excludeFacility,"schoolroom")>>
 	<<link $schoolroomNameCaps>>
-		<<set _excludeFacility.push("schoolroom")>>
+		<<set $currentRule.facility = []>>
+		<<set $currentRule.excludeFacility.push("schoolroom")>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
+		<<RAChangeApplyFacility>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
@@ -1050,7 +1142,7 @@ Exclude facilities:
 <<else>>
 	''$schoolroomNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_excludeFacility, "schoolroom")>>
+		<<set removeFromArray($currentRule.excludeFacility, "schoolroom")>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -1059,10 +1151,13 @@ Exclude facilities:
 <</if>>
 <<if ($spa > 0)>>
 |
-<<if !ruleFacility(_excludeFacility,"spa")>>
+<<if !ruleFacility($currentRule.excludeFacility,"spa")>>
 	<<link $spaNameCaps>>
-		<<set _excludeFacility.push("spa")>>
+		<<set $currentRule.facility = []>>
+		<<set $currentRule.excludeFacility.push("spa")>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
+		<<RAChangeApplyFacility>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
@@ -1071,7 +1166,7 @@ Exclude facilities:
 <<else>>
 	''$spaNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_excludeFacility, "spa")>>
+		<<set removeFromArray($currentRule.excludeFacility, "spa")>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -1080,10 +1175,13 @@ Exclude facilities:
 <</if>>
 <<if ($clinic > 0)>>
 |
-<<if !ruleFacility(_excludeFacility,"clinic")>>
+<<if !ruleFacility($currentRule.excludeFacility,"clinic")>>
 	<<link $clinicNameCaps>>
-		<<set _excludeFacility.push("clinic")>>
+		<<set $currentRule.facility = []>>
+		<<set $currentRule.excludeFacility.push("clinic")>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
+		<<RAChangeApplyFacility>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
@@ -1092,7 +1190,7 @@ Exclude facilities:
 <<else>>
 ''$clinicNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_excludeFacility, "clinic")>>
+		<<set removeFromArray($currentRule.excludeFacility, "clinic")>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -1101,10 +1199,13 @@ Exclude facilities:
 <</if>>
 <<if ($cellblock > 0)>>
 |
-<<if !ruleFacility(_excludeFacility,"cellblock")>>
+<<if !ruleFacility($currentRule.excludeFacility,"cellblock")>>
 	<<link $cellblockNameCaps>>
-		<<set _excludeFacility.push("cellblock")>>
+		<<set $currentRule.facility = []>>
+		<<set $currentRule.excludeFacility.push("cellblock")>>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
+		<<RAChangeApplyFacility>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
@@ -1113,7 +1214,7 @@ Exclude facilities:
 <<else>>
 	''$cellblockNameCaps''
 	<<link Stop>>
-		<<set removeFromArray(_excludeFacility, "cellblock")>>
+		<<set removeFromArray($currentRule.excludeFacility, "cellblock")>>
 		<<RAChangeExcludeFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
@@ -1130,9 +1231,9 @@ Exclude facilities:
 <<widget "RAChangeSetAssignment">>
 
 <<replace #setassignment>>
+<br><br>
 <<if ($currentRule.setAssignment != "none")>>
-''Automatically set assignment:''
-<br>
+  Automatically set assignment:
 	<<link "None">>
 		<<set $currentRule.setAssignment = "none">>
 		<<RAChangeSetAssignment>>
@@ -1140,16 +1241,16 @@ Exclude facilities:
 		<<RAChangeApply>>
 	<</link>>
 <<else>>
-Automatically set assignment:
-<br>
+  @@.gray;Automatically set assignment:@@
 	''None''
 <</if>>
 |
 <<if ($currentRule.setAssignment != "rest")>>
 	<<link "Rest">>
+		<<set removeFromArray($currentRule.assignment, "rest")>>
 		<<set $currentRule.setAssignment = "rest">>
 		<<set $currentRule.assignFacility = "none">>
-		<<set $currentRule.assignment = []>>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyAssignment>>
 		<<RAChangeSetAssignment>>
 		<<RAChangeAssignFacility>>
@@ -1162,9 +1263,10 @@ Automatically set assignment:
 |
 <<if ($currentRule.setAssignment != "please you")>>
 	<<link "Fucktoy">>
+		<<set removeFromArray($currentRule.assignment, "please you")>>
 		<<set $currentRule.setAssignment = "please you">>
 		<<set $currentRule.assignFacility = "none">>
-		<<set $currentRule.assignment = []>>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyAssignment>>
 		<<RAChangeSetAssignment>>
 		<<RAChangeAssignFacility>>
@@ -1177,9 +1279,10 @@ Automatically set assignment:
 |
 <<if ($currentRule.setAssignment != "be a servant")>>
 	<<link "House Servant">>
+		<<set removeFromArray($currentRule.assignment, "be a servant")>>
 		<<set $currentRule.setAssignment = "be a servant">>
 		<<set $currentRule.assignFacility = "none">>
-		<<set $currentRule.assignment = []>>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyAssignment>>
 		<<RAChangeSetAssignment>>
 		<<RAChangeAssignFacility>>
@@ -1192,9 +1295,10 @@ Automatically set assignment:
 |
 <<if ($currentRule.setAssignment != "stay confined")>>
 	<<link "Confined">>
+		<<set removeFromArray($currentRule.assignment, "stay confined")>>
 		<<set $currentRule.setAssignment = "stay confined">>
 		<<set $currentRule.assignFacility = "none">>
-		<<set $currentRule.assignment = []>>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyAssignment>>
 		<<RAChangeSetAssignment>>
 		<<RAChangeAssignFacility>>
@@ -1207,9 +1311,10 @@ Automatically set assignment:
 |
 <<if ($currentRule.setAssignment != "whore")>>
 	<<link "Whore">>
+		<<set removeFromArray($currentRule.assignment, "whore")>>
 		<<set $currentRule.setAssignment = "whore">>
 		<<set $currentRule.assignFacility = "none">>
-		<<set $currentRule.assignment = []>>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyAssignment>>
 		<<RAChangeSetAssignment>>
 		<<RAChangeAssignFacility>>
@@ -1222,9 +1327,10 @@ Automatically set assignment:
 |
 <<if ($currentRule.setAssignment != "serve the public")>>
 	<<link "Public Servant">>
+		<<set removeFromArray($currentRule.assignment, "serve the public")>>
 		<<set $currentRule.setAssignment = "serve the public">>
 		<<set $currentRule.assignFacility = "none">>
-		<<set $currentRule.assignment = []>>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyAssignment>>
 		<<RAChangeSetAssignment>>
 		<<RAChangeAssignFacility>>
@@ -1237,9 +1343,10 @@ Automatically set assignment:
 |
 <<if ($currentRule.setAssignment != "get milked")>>
 	<<link "Milking">>
+		<<set removeFromArray($currentRule.assignment, "get milked")>>
 		<<set $currentRule.setAssignment = "get milked">>
 		<<set $currentRule.assignFacility = "none">>
-		<<set $currentRule.assignment = []>>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyAssignment>>
 		<<RAChangeSetAssignment>>
 		<<RAChangeAssignFacility>>
@@ -1252,39 +1359,19 @@ Automatically set assignment:
 |
 <<if ($currentRule.setAssignment != "work a glory hole")>>
 	<<link "Gloryhole">>
+		<<set removeFromArray($currentRule.assignment, "work a glory hole")>>
 		<<set $currentRule.setAssignment = "work a glory hole">>
 		<<set $currentRule.assignFacility = "none">>
-		<<set $currentRule.assignment = []>>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeApplyAssignment>>
 		<<RAChangeSetAssignment>>
-		<<RAChangeApplyFacility>>
+		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
 <<else>>
 	''Gloryhole''
 <</if>>
-<<if ($currentRule.setAssignment != "none")>>
-<br>
-  Exclude special slaves:
-<<if $currentRule.excludeSpecialSlaves>>
-	''True'' |
-	<<link False>>
-		<<set $currentRule.excludeSpecialSlaves = false>>
-		<<RAChangeSetAssignment>>
-		<<RAChangeSave>>
-		<<RAChangeApply>>
-	<</link>>
-<<else>>
-	''False'' |
-	<<link True>>
-		<<set $currentRule.excludeSpecialSlaves = true>>
-		<<RAChangeSetAssignment>>
-		<<RAChangeSave>>
-		<<RAChangeApply>>
-	<</link>>
-<</if>>
-<</if>>
 <</replace>>
 <</widget>>
 
@@ -1295,19 +1382,18 @@ Automatically set assignment:
 
 <<replace #assignfacility>>
 <<if ($HGSuite > 0) || ($brothel > 0) || ($club > 0) || ($arcade > 0) || ($dairy > 0) || ($servantsQuarters > 0) || ($masterSuite > 0) || ($schoolroom > 0) || ($spa > 0) || ($clinic > 0) || ($cellblock > 0)>>
-<br><br>
-<<if ($currentRule.assignFacility != "none")>>
-''Automatically assign slaves to facility:''
 <br>
+<<if ($currentRule.assignFacility != "none")>>
+  Automatically assign slaves to facility:
 	<<link "None">>
 		<<set $currentRule.assignFacility = "none">>
+		<<set $currentRule.facilityRemove = false>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
 <<else>>
-Automatically assign slaves to facility:
-<br>
+  @@.gray;Automatically assign slaves to facility:@@
 	''None''
 <</if>>
 <<if ($HGSuite > 0)>>
@@ -1316,8 +1402,11 @@ Automatically assign slaves to facility:
 	<<link $HGSuiteNameCaps>>
 		<<set $currentRule.assignFacility = "hgsuite">>
 		<<set $currentRule.setAssignment = "none">>
-		<<set $currentRule.facility = []>>
-		<<set _facility = []>>
+		<<set removeFromArray($currentRule.facility, "hgsuite")>>
+		<<if $currentRule.facility.length == 0>>
+			<<set $currentRule.excludeFacility.push("hgsuite")>>
+			<<RAChangeExcludeFacility>>
+		<</if>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSetAssignment>>
 		<<RAChangeApplyFacility>>
@@ -1334,8 +1423,11 @@ Automatically assign slaves to facility:
 	<<link $brothelNameCaps>>
 		<<set $currentRule.assignFacility = "brothel">>
 		<<set $currentRule.setAssignment = "none">>
-		<<set $currentRule.facility = []>>
-		<<set _facility = []>>
+		<<set removeFromArray($currentRule.facility, "brothel")>>
+		<<if $currentRule.facility.length == 0>>
+			<<set $currentRule.excludeFacility.push("brothel")>>
+			<<RAChangeExcludeFacility>>
+		<</if>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSetAssignment>>
@@ -1352,8 +1444,11 @@ Automatically assign slaves to facility:
 	<<link $clubNameCaps>>
 		<<set $currentRule.assignFacility = "club">>
 		<<set $currentRule.setAssignment = "none">>
-		<<set $currentRule.facility = []>>
-		<<set _facility = []>>
+		<<set removeFromArray($currentRule.facility, "club")>>
+		<<if $currentRule.facility.length == 0>>
+			<<set $currentRule.excludeFacility.push("club")>>
+			<<RAChangeExcludeFacility>>
+		<</if>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSetAssignment>>
@@ -1370,8 +1465,11 @@ Automatically assign slaves to facility:
 	<<link $arcadeNameCaps>>
 		<<set $currentRule.assignFacility = "arcade">>
 		<<set $currentRule.setAssignment = "none">>
-		<<set $currentRule.facility = []>>
-		<<set _facility = []>>
+		<<set removeFromArray($currentRule.facility, "arcade")>>
+		<<if $currentRule.facility.length == 0>>
+			<<set $currentRule.excludeFacility.push("arcade")>>
+			<<RAChangeExcludeFacility>>
+		<</if>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSetAssignment>>
@@ -1388,8 +1486,11 @@ Automatically assign slaves to facility:
 	<<link $dairyNameCaps>>
 		<<set $currentRule.assignFacility = "dairy">>
 		<<set $currentRule.setAssignment = "none">>
-		<<set $currentRule.facility = []>>
-		<<set _facility = []>>
+		<<set removeFromArray($currentRule.facility, "dairy")>>
+		<<if $currentRule.facility.length == 0>>
+			<<set $currentRule.excludeFacility.push("dairy")>>
+			<<RAChangeExcludeFacility>>
+		<</if>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSetAssignment>>
@@ -1406,8 +1507,11 @@ Automatically assign slaves to facility:
 	<<link $servantsQuartersNameCaps>>
 		<<set $currentRule.assignFacility = "servantsquarters">>
 		<<set $currentRule.setAssignment = "none">>
-		<<set $currentRule.facility = []>>
-		<<set _facility = []>>
+		<<set removeFromArray($currentRule.facility, "servantsquarters")>>
+		<<if $currentRule.facility.length == 0>>
+			<<set $currentRule.excludeFacility.push("servantsquarters")>>
+			<<RAChangeExcludeFacility>>
+		<</if>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSetAssignment>>
@@ -1424,8 +1528,11 @@ Automatically assign slaves to facility:
 	<<link $masterSuiteNameCaps>>
 		<<set $currentRule.assignFacility = "mastersuite">>
 		<<set $currentRule.setAssignment = "none">>
-		<<set $currentRule.facility = []>>
-		<<set _facility = []>>
+		<<set removeFromArray($currentRule.facility, "mastersuite")>>
+		<<if $currentRule.facility.length == 0>>
+			<<set $currentRule.excludeFacility.push("mastersuite")>>
+			<<RAChangeExcludeFacility>>
+		<</if>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSetAssignment>>
@@ -1442,8 +1549,11 @@ Automatically assign slaves to facility:
 	<<link $schoolroomNameCaps>>
 		<<set $currentRule.assignFacility = "schoolroom">>
 		<<set $currentRule.setAssignment = "none">>
-		<<set $currentRule.facility = []>>
-		<<set _facility = []>>
+		<<set removeFromArray($currentRule.facility, "schoolroom")>>
+		<<if $currentRule.facility.length == 0>>
+			<<set $currentRule.excludeFacility.push("schoolroom")>>
+			<<RAChangeExcludeFacility>>
+		<</if>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSetAssignment>>
@@ -1460,8 +1570,11 @@ Automatically assign slaves to facility:
 	<<link $spaNameCaps>>
 		<<set $currentRule.assignFacility = "spa">>
 		<<set $currentRule.setAssignment = "none">>
-		<<set $currentRule.facility = []>>
-		<<set _facility = []>>
+		<<set removeFromArray($currentRule.facility, "spa")>>
+		<<if $currentRule.facility.length == 0>>
+			<<set $currentRule.excludeFacility.push("spa")>>
+			<<RAChangeExcludeFacility>>
+		<</if>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSetAssignment>>
@@ -1478,8 +1591,11 @@ Automatically assign slaves to facility:
 	<<link $clinicNameCaps>>
 		<<set $currentRule.assignFacility = "clinic">>
 		<<set $currentRule.setAssignment = "none">>
-		<<set $currentRule.facility = []>>
-		<<set _facility = []>>
+		<<set removeFromArray($currentRule.facility, "clinic")>>
+		<<if $currentRule.facility.length == 0>>
+			<<set $currentRule.excludeFacility.push("clinic")>>
+			<<RAChangeExcludeFacility>>
+		<</if>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSetAssignment>>
@@ -1496,8 +1612,11 @@ Automatically assign slaves to facility:
 	<<link $cellblockNameCaps>>
 		<<set $currentRule.assignFacility = "cellblock">>
 		<<set $currentRule.setAssignment = "none">>
-		<<set $currentRule.facility = []>>
-		<<set _facility = []>>
+		<<set removeFromArray($currentRule.facility, "cellblock")>>
+		<<if $currentRule.facility.length == 0>>
+			<<set $currentRule.excludeFacility.push("cellblock")>>
+			<<RAChangeExcludeFacility>>
+		<</if>>
 		<<RAChangeApplyFacility>>
 		<<RAChangeAssignFacility>>
 		<<RAChangeSetAssignment>>
@@ -1508,28 +1627,9 @@ Automatically assign slaves to facility:
 	''$cellblockNameCaps''
 <</if>>
 <</if>>
-<<if ($currentRule.assignFacility != "none")>>
-<br>
-  Exclude special slaves:
-<<if $currentRule.excludeSpecialSlaves>>
-	''True'' |
-	<<link False>>
-		<<set $currentRule.excludeSpecialSlaves = false>>
-		<<RAChangeAssignFacility>>
-		<<RAChangeSave>>
-		<<RAChangeApply>>
-	<</link>>
-<<else>>
-	''False'' |
-	<<link True>>
-		<<set $currentRule.excludeSpecialSlaves = true>>
-		<<RAChangeAssignFacility>>
-		<<RAChangeSave>>
-		<<RAChangeApply>>
-	<</link>>
-<</if>>
-<br>
-  Automatically remove from facility:
+<<if $currentRule.assignFacility != "none">>
+<br>&nbsp;&nbsp;&nbsp;&nbsp;
+Automatically remove from facility when rule no longer applies (only if it was applied before):
 <<if $currentRule.facilityRemove>>
 	''True'' |
 	<<link False>>
@@ -1547,9 +1647,8 @@ Automatically assign slaves to facility:
 		<<RAChangeApply>>
 	<</link>>
 <</if>>
-<br>
-  Assignment on removal:
-$currentRule.removalAssignment |
+<br>&nbsp;&nbsp;&nbsp;&nbsp;
+Assignment on removal: $currentRule.removalAssignment |
 <<if ($currentRule.removalAssignment != "rest")>>
 	<<link Rest>>
 		<<set $currentRule.removalAssignment = "rest">>
@@ -1557,8 +1656,6 @@ $currentRule.removalAssignment |
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>> |
-<<else>>
-''Rest'' |
 <</if>>
 <<if ($currentRule.removalAssignment != "please you")>>
 	<<link "Please you">>
@@ -1567,8 +1664,6 @@ $currentRule.removalAssignment |
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>> |
-<<else>>
-''Please you'' |
 <</if>>
 <<if ($currentRule.removalAssignment != "whore")>>
 	<<link Whore>>
@@ -1577,8 +1672,6 @@ $currentRule.removalAssignment |
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>> |
-<<else>>
-''Whore'' |
 <</if>>
 <<if ($currentRule.removalAssignment != "serve the public")>>
 	<<link "Public servant">>
@@ -1587,8 +1680,6 @@ $currentRule.removalAssignment |
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>> |
-<<else>>
-''Public servant'' |
 <</if>>
 <<if ($currentRule.removalAssignment != "get milked")>>
 	<<link "Get milked">>
@@ -1597,8 +1688,6 @@ $currentRule.removalAssignment |
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>> |
-<<else>>
-''Get milked'' |
 <</if>>
 <<if ($currentRule.removalAssignment != "stay confined")>>
 	<<link "Stay confined">>
@@ -1607,8 +1696,6 @@ $currentRule.removalAssignment |
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>> |
-<<else>>
-''Stay confined'' |
 <</if>>
 <<if ($currentRule.removalAssignment != "work a glory hole")>>
 	<<link "Glory hole">>
@@ -1617,14 +1704,40 @@ $currentRule.removalAssignment |
 		<<RAChangeSave>>
 		<<RAChangeApply>>
 	<</link>>
-<<else>>
-''Glory hole''
 <</if>>
 <</if>>
 <</if>>
 <</replace>>
 <</widget>>
 
+/%
+ Call as <<RASpecialSlaves>>
+%/
+<<widget "RASpecialSlaves">>
+<<replace #specialslaves>>
+<br><br>
+<<if $currentRule.excludeSpecialSlaves>>
+	Excluding special slaves:
+	''True'' |
+	<<link False>>
+		<<set $currentRule.excludeSpecialSlaves = false>>
+		<<RASpecialSlaves>>
+		<<RAChangeSave>>
+		<<RAChangeApply>>
+	<</link>>
+<<else>>
+	@@.gray;Exclude special slaves:@@
+	''False'' |
+	<<link True>>
+		<<set $currentRule.excludeSpecialSlaves = true>>
+		<<RASpecialSlaves>>
+		<<RAChangeSave>>
+		<<RAChangeApply>>
+	<</link>>
+<</if>>
+<</replace>>
+<</widget>>
+
 /%
  Call as <<RAChangeClothes>>
 %/
@@ -1900,7 +2013,8 @@ Slave diets:
 <</replace>>
 <<replace #dietsupport>>
 <<if $currentRule.diet !== "no default setting">>
-<br>&nbsp;&nbsp;&nbsp;&nbsp;Diet support for growth drugs:
+<br>&nbsp;&nbsp;&nbsp;&nbsp;
+Diet support for growth drugs:
 <<if $currentRule.dietGrowthSupport == 1>>
 	''on.''
 <<else>>
@@ -2183,25 +2297,24 @@ Relationship rules: ''$currentRule.relationshipRules.''
 %/
 <<widget "RAChangeSave">>
 <<replace #saveresult>>
-<<link _text>>
-	<<replace "#saveresult">>
-	//Rule saved.//
-	<<for _t = 0; _t < $defaultRules.length; _t++>>
-		<<if $currentRule.ID == $defaultRules[_t].ID>>
-			<<if $currentRule.thresholdLower != "none">>
-				<<set $currentRule.thresholdLower = Number($currentRule.thresholdLower)>>
-			<</if>>
-			<<if $currentRule.thresholdUpper != "none">>
-				<<set $currentRule.thresholdUpper = Number($currentRule.thresholdUpper)>>
-			<</if>>
-			<<set $currentRule.facility = _facility>>
-			<<set $currentRule.excludeFacility = _excludeFacility>>
-			<<set $defaultRules[_t] = $currentRule>>
-			<<break>>
-		<</if>>
-	<</for>>
-	<</replace>>
-<</link>>
+	<br><br>
+	<<link _text>>
+		<<replace "#saveresult">>
+			<br><br>//Rule $r saved//
+			<<for _t = 0; _t < $defaultRules.length; _t++>>
+				<<if $currentRule.ID == $defaultRules[_t].ID>>
+					<<if $currentRule.thresholdLower != "none">>
+						<<set $currentRule.thresholdLower = Number($currentRule.thresholdLower)>>
+					<</if>>
+					<<if $currentRule.thresholdUpper != "none">>
+						<<set $currentRule.thresholdUpper = Number($currentRule.thresholdUpper)>>
+					<</if>>
+					<<set $defaultRules[_t] = $currentRule>>
+					<<break>>
+				<</if>>
+			<</for>>
+		<</replace>>
+	<</link>>
 <</replace>>
 <</widget>>
 /%
@@ -2210,46 +2323,38 @@ Relationship rules: ''$currentRule.relationshipRules.''
 %/
 <<widget "RAChangeApply">>
 <<replace #apply>>
-<span id="applyresult">
-<<link "Apply rules">>
-	<<replace "#applyresult">>
-	//Rules applied.//
-	<</replace>>
-	<<replace "#applied">>
-	<<for _t = 0; _t < $defaultRules.length; _t++>>
-		<<if $currentRule.ID == $defaultRules[_t].ID>>
-			<<set $currentRule.facility = _facility>>
-			<<set $currentRule.excludeFacility = _excludeFacility>>
-			<<if $currentRule.thresholdLower != "none">>
-				<<set $currentRule.thresholdLower = Number($currentRule.thresholdLower)>>
-			<</if>>
-			<<if $currentRule.thresholdUpper != "none">>
-				<<set $currentRule.thresholdUpper = Number($currentRule.thresholdUpper)>>
-			<</if>>
-			<<set $defaultRules[_t] = $currentRule>>
-		<</if>>
-	<</for>>
-	<<for $i = 0; $i < $slaves.length; $i++>>
-		  <<if $slaves[$i].useRulesAssistant == 1>>
-		  <<set $activeSlave = $slaves[$i]>>
-		  <<CheckAutoRulesActivate $activeSlave>>
-		  <<DefaultRules $activeSlave>>
-		  /*<<set $slaves[$i] = $activeSlave>>*/
-		  <</if>>
-	<</for>>
-
-	<<for _t = 0; _t < $defaultRules.length; _t++>>
-		<<set _r = $r-1>>
-		<<if $defaultRules[_t].ID == $defaultRules[_r].ID>>
-			<<set $currentRule = $defaultRules[_t]>>
-			<<set _facility = $currentRule.facility>>
-			<<set _excludeFacility = $currentRule.excludeFacility>>
-			<<break>>
-		<</if>>
-	<</for>>
-	<</replace>>
-<</link>>
-</span>
+	<span id="applyresult">
+	<<link "Apply rules">>
+		<<replace "#saveresult">>
+			<br><br>//Rule $r saved//
+			<<for _t = 0; _t < $defaultRules.length; _t++>>
+				<<if $currentRule.ID == $defaultRules[_t].ID>>
+					<<if $currentRule.thresholdLower != "none">>
+						<<set $currentRule.thresholdLower = Number($currentRule.thresholdLower)>>
+					<</if>>
+					<<if $currentRule.thresholdUpper != "none">>
+						<<set $currentRule.thresholdUpper = Number($currentRule.thresholdUpper)>>
+					<</if>>
+					<<set $defaultRules[_t] = $currentRule>>
+					<<break>>
+				<</if>>
+			<</for>>
+		<</replace>>
+		<<replace "#applied">>
+			<<for $i = 0; $i < $slaves.length; $i++>>
+				<<if $slaves[$i].useRulesAssistant == 1>> /* skip RA-exempt slaves */
+				  <<set $activeSlave = $slaves[$i]>>
+				  <<CheckAutoRulesActivate $activeSlave>> /* does not use or modify $currentRule */
+				  <<DefaultRules $activeSlave>> /* does not use or modify $currentRule */
+				<</if>>
+			<</for>>
+		<</replace>>
+		<<replace "#applyresult">>
+			//Rules applied.//<br>
+		<</replace>>
+	<</link>>
+	</span>
+	<span id="applied"></span>
 <</replace>>
 <</widget>>
 
@@ -2974,17 +3079,20 @@ Your brand design is ''$brandDesign.''
 			<<set _dump = $args[0].currentRules.deleteAt(_s)>>
 		<</if>>
 	<</for>>
-	<br>Rule _rule (_currentRule.name) is no longer applying to $args[0].slaveName.
-	<<include "Rules Facility Remove">>
+	<br>//@@.tan;Rule _rule (_currentRule.name) is no longer applying to $args[0].slaveName, who is assigned to $args[0].assignment.@@//
+	<<if $args[0].assignmentVisible == 0>>
+		<<include "Rules Facility Remove">>
+	<</if>>
 <</widget>>
 
 /%
 	Call as <<DefaultRules SlaveObject>>
+	Does not use or modify $currentRule
 %/
 <<widget "DefaultRules">>
 <<for _r = 0; _r < $defaultRules.length; _r++>>
 <<set _currentRule = $defaultRules[_r]>>
-<<if !ruleApplied($args[0], _currentRule.ID) || (def _currentRule.facility && _currentRule.facility.length > 0 && !ruleAppliedToSlaveFacility(_currentRule, $args[0]))>><<continue>><</if>>
+<<if !ruleApplied($args[0], _currentRule.ID)>><<continue>><</if>>
 
 <<if $args[0].fuckdoll == 0>>
 
@@ -4411,21 +4519,19 @@ consequences.
 <</if>>
 
 <<set _exclude = false>>
-<<if _currentRule.excludeSpecialSlaves>>
+<<if $args[0].assignment.includes("agent")>>
+	<<set _exclude = true>>
+<<elseif _currentRule.excludeSpecialSlaves>>
 	<<if (($HeadGirl != 0) && ($HeadGirl.ID == $args[0].ID)) || (($Bodyguard != 0) && ($Bodyguard.ID == $args[0].ID)) || (($Recruiter != 0) && ($Recruiter.ID == $args[0].ID)) || (($Concubine != 0) && ($Concubine.ID == $args[0].ID)) || (($Nurse != 0) && ($Nurse.ID == $args[0].ID)) || (($Attendant != 0) && ($Attendant.ID == $args[0].ID)) || (($Madam != 0) || ($Madam.ID == $args[0].ID)) || (($DJ != 0) && ($DJ.ID == $args[0].ID)) || (($Milkmaid != 0) && ($Milkmaid.ID == $args[0].ID)) || (($Stewardess != 0 ) && ($Stewardess.ID == $args[0].ID)) || (($Schoolteacher != 0) && ($Schoolteacher.ID == $args[0].ID)) || (($Wardeness != 0) && ($Wardeness.ID == $args[0].ID))>>
 		<<set _exclude = true>>
 	<</if>>
 <</if>>
 
-<<if $args[0].assignmentVisible != 1>>
-	<<set _exclude = true>>
-<</if>>
-
 <<if !_exclude>>
 <<switch _currentRule.assignFacility>>
 <<case "hgsuite">>
 	<<if ($args[0].indentureRestrictions <= 0) && ($args[0].assignment != "live with your Head Girl")>>
-		<br>$args[0].slaveName has automatically been assigned to $args[0].assignment.
+		<br>$args[0].slaveName has been automatically assigned to live in your Head Girl's private suite.
 		<<if ($personalAttention == $args[0].ID)>>
 			$args[0].slaveName no longer has your personal attention; you plan to focus on business.
 		<</if>>
@@ -4433,7 +4539,7 @@ consequences.
 	<</if>>
 <<case "arcade">>
 	<<if ($arcade > $arcadeSlaves) && ($args[0].indentureRestrictions <= 0) && ($args[0].assignment != "be confined in the arcade") && $args[0].breedingMark != 1>>
-		<br>$args[0].slaveName has automatically been assigned to $args[0].assignment.
+		<br>$args[0].slaveName has been automatically assigned to be confined in $arcadeName.
 		<<if ($personalAttention == $args[0].ID)>>
 			$args[0].slaveName no longer has your personal attention; you plan to focus on business.
 		<</if>>
@@ -4442,7 +4548,7 @@ consequences.
 <<case "mastersuite">>
 	<<if ($masterSuite > $masterSuiteSlaves) && ($args[0].devotion > 20) || (($args[0].devotion >= -50) && ($args[0].trust < -20)) || ($args[0].trust < -50)>>
 	<<if ($args[0].assignment != "serve in the master suite")>>
-		<br>$args[0].slaveName has automatically been assigned to $args[0].assignment.
+		<br>$args[0].slaveName has been automatically assigned to $masterSuiteName.
 		<<if ($personalAttention == $args[0].ID)>>
 			$args[0].slaveName no longer has your personal attention; you plan to focus on business.
 		<</if>>
@@ -4456,7 +4562,7 @@ consequences.
 <<case "clinic">>
 	<<if ($clinic > $clinicSlaves) && ($args[0].health < 20) || (($Nurse != 0) && ($args[0].chem > 15) && ($clinicUpgradeFilters == 1)) || (($args[0].bellyImplant > 100) && ($bellyImplants == 1)) || $args[0].preg > 1>>
 	<<if ($args[0].assignment != "get treatment in the clinic")>>
-		<br>$args[0].slaveName has automatically been assigned to $args[0].assignment.
+		<br>$args[0].slaveName has been automatically assigned to get treatment in $clinicName.
 		<<if ($personalAttention == $args[0].ID)>>
 			$args[0].slaveName no longer has your personal attention; you plan to focus on business.
 		<</if>>
@@ -4470,7 +4576,7 @@ consequences.
 <<case "spa">>
 	<<if ($spa > $spaSlaves) && ($args[0].health < 20) || ($args[0].trust < 60) || ($args[0].devotion <= 60) || ($args[0].fetish == "mindbroken") && ($args[0].devotion >= -20)>>
 	<<if ($args[0].assignment != "rest in the spa")>>
-		<br>$args[0].slaveName has automatically been assigned to $args[0].assignment.
+		<br>$args[0].slaveName has been automatically assigned to rest in $spaName.
 		<<if ($personalAttention == $args[0].ID)>>
 			$args[0].slaveName no longer has your personal attention; you plan to focus on business.
 		<</if>>
@@ -4484,7 +4590,7 @@ consequences.
 <<case "brothel">>
 	<<if ($brothel > $brothelSlaves) && ($args[0].devotion > 50) || (($args[0].devotion >= -50) && ($args[0].trust < -20)) || ($args[0].trust < -50) || ($args[0].trust > 50) && $args[0].breedingMark != 1>>
 	<<if ($args[0].assignment != "work in the brothel")>>
-		<br>$args[0].slaveName has automatically been assigned to $args[0].assignment.
+		<br>$args[0].slaveName has been automatically assigned to work in $brothelName.
 		<<if ($personalAttention == $args[0].ID)>>
 			$args[0].slaveName no longer has your personal attention; you plan to focus on business.
 		<</if>>
@@ -4496,9 +4602,9 @@ consequences.
 		<</if>>
 	<</if>>
 <<case "club">>
-	<<if ($club > $clubSlaves)  && ($args[0].devotion > 50) || (($args[0].devotion >= -50) && ($args[0].trust < -20)) || ($args[0].trust < -50) || ($args[0].trust > 50) && $args[0].breedingMark != 1>>
+	<<if ($club > $clubSlaves) && ($args[0].devotion > 50) || (($args[0].devotion >= -50) && ($args[0].trust < -20)) || ($args[0].trust < -50) || ($args[0].trust > 50) && $args[0].breedingMark != 1>>
 	<<if ($args[0].assignment != "serve in the club")>>
-		<br>$args[0].slaveName has automatically been assigned to $args[0].assignment.
+		<br>$args[0].slaveName has been automatically assigned to serve in $clubName.
 		<<if ($personalAttention == $args[0].ID)>>
 			$args[0].slaveName no longer has your personal attention; you plan to focus on business.
 		<</if>>
@@ -4519,7 +4625,7 @@ consequences.
 		<<if ($dairyStimulatorsSetting < 2) || ($args[0].anus > 2) || ($dairyPrepUpgrade == 1)>>
 		<<if ($dairyPregSetting < 2) || ($args[0].vagina > 2) || ($args[0].ovaries == 0) || ($dairyPrepUpgrade == 1)>>
 	<<if ($args[0].assignment != "work in the dairy")>>
-		<br>$args[0].slaveName has automatically been assigned to $args[0].assignment.
+		<br>$args[0].slaveName has been automatically assigned to be milked in $dairyName.
 		<<if ($personalAttention == $args[0].ID)>>
 			$args[0].slaveName no longer has your personal attention; you plan to focus on business.
 		<</if>>
@@ -4550,7 +4656,7 @@ consequences.
 <<case "servantsquarters">>
 	<<if ($servantsQuarters > $servantsQuartersSlaves) && ($args[0].devotion >= -20) || (($args[0].devotion >= -50) && ($args[0].trust <= 20)) || ($args[0].trust < -20)>>
 	<<if ($args[0].assignment != "work as a servant")>>
-		<br>$args[0].slaveName has automatically been assigned to $args[0].assignment.
+		<br>$args[0].slaveName has been automatically assigned to work in $servantsQuartersName.
 		<<if ($personalAttention == $args[0].ID)>>
 			$args[0].slaveName no longer has your personal attention; you plan to focus on business.
 		<</if>>
@@ -4565,7 +4671,7 @@ consequences.
 	<<if ($schoolroom > $schoolroomSlaves) && ($args[0].fetish != "mindbroken") && ($args[0].devotion >= -20 || ($args[0].devotion >= -50 && $args[0].trust < -20) || $args[0].trust < -50)>>
 	<<if ($args[0].intelligenceImplant < 1) || ($args[0].voice != 0 && $args[0].accent+$schoolroomUpgradeLanguage > 2) || ($args[0].oralSkill <= 10+$schoolroomUpgradeSkills*20) || ($args[0].whoreSkill <= 10+$schoolroomUpgradeSkills*20) || ($args[0].entertainSkill <= 10+$schoolroomUpgradeSkills*20) || ($args[0].analSkill < 10+$schoolroomUpgradeSkills*20) || (($args[0].vagina >= 0) && ($args[0].vaginalSkill < 10+$schoolroomUpgradeSkills*20))>>
 	<<if ($args[0].assignment != "learn in the schoolroom")>>
-		<br>$args[0].slaveName has automatically been assigned to $args[0].assignment.
+		<br>$args[0].slaveName has been automatically assigned to study in $schoolroomName.
 		<<if ($personalAttention == $args[0].ID)>>
 			$args[0].slaveName no longer has your personal attention; you plan to focus on business.
 		<</if>>
@@ -4584,7 +4690,7 @@ consequences.
 <<case "cellblock">>
 	<<if ($cellblock > $cellblockSlaves ) && (($args[0].devotion < -20) && ($args[0].trust >= -20)) || (($args[0].devotion < -50) && ($args[0].trust >= -50))>>
 	<<if ($args[0].assignment != "be confined in the cellblock")>>
-		<br>$args[0].slaveName has automatically been assigned to $args[0].assignment.
+		<br>$args[0].slaveName has been automatically assigned to be confined in $cellblockName.
 		<<if ($personalAttention == $args[0].ID)>>
 			$args[0].slaveName no longer has your personal attention; you plan to focus on business.
 		<</if>>
@@ -4599,10 +4705,10 @@ consequences.
 <</if>>
 
 <<if !_exclude>>
-<<if def _currentRule.setAssignment && _currentRule.setAssignment !== "none">>
+<<if _currentRule.setAssignment !== "none">>
 	<<if ($args[0].assignment !== _currentRule.setAssignment)>>
-		<<set $args[0].assignment = _currentRule.setAssignment>>
-		<br>$args[0].slaveName has automatically been assigned to $args[0].assignment.
+		<br>$args[0].slaveName has been automatically assigned to _currentRule.setAssignment.
+		<<assignJob $args[0] _currentRule.setAssignment>>
 	<</if>>
 <</if>>
 <</if>>
@@ -4612,198 +4718,97 @@ consequences.
 
 /%
 	Call as <<CheckAutoRulesActivate SlaveObject>>
+	Does not use or modify $currentRule
 %/
 <<widget "CheckAutoRulesActivate">>
-<<if (ndef $args[0].currentRules) || ($args[0].currentRules.length < 1)>>
-	<<set $args[0].currentRules = []>>
-<</if>>
-
-<<for _r = 0; _r < $defaultRules.length; _r++>>
-<<set _currentRule = $defaultRules[_r]>>
-<<set _rule = _r+1>>
-
-<<if ruleApplied($args[0], _currentRule.ID)>>
-	<<if (def _currentRule.excludedSlaves) && (_currentRule.excludedSlaves.length > 0) && ruleSlaveExcluded($args[0], _currentRule)>>
-		<<RARemoveRule $args[0]>>
-		<<continue>>
-	<<elseif (def _currentRule.selectedSlaves) && (_currentRule.selectedSlaves.length > 0) && !ruleSlaveSelected($args[0], _currentRule)>>
-		<<RARemoveRule $args[0]>>
-		<<continue>>
-	<</if>>
-	<<if $args[0].assignmentVisible == 0>>
-		<<if (def _currentRule.excludeFacility) && (_currentRule.excludeFacility.length > 0) && ruleExcludeSlaveFacility(_currentRule, $args[0])>>
-			<<RARemoveRule $args[0]>>
-			<<continue>>
-		<<elseif (def _currentRule.facility) && (_currentRule.facility.length > 0) && !ruleAppliedToSlaveFacility(_currentRule, $args[0])>>
-			<<RARemoveRule $args[0]>>
-			<<continue>>
-		<</if>>
-	<<else>>
-		<<if (def _currentRule.excludeAssignment) && (_currentRule.excludeAssignment.length > 0) && ruleAssignment(_currentRule.excludeAssignment, $args[0].assignment)>>
-			<<RARemoveRule $args[0]>>
-			<<continue>>
-		<<elseif (def _currentRule.assignment) && (_currentRule.assignment.length > 0) && !ruleAssignment(_currentRule.assignment, $args[0].assignment)>>
-			<<RARemoveRule $args[0]>>
-			<<continue>>
-		<</if>>
+	<<if (ndef $args[0].currentRules) || ($args[0].currentRules.length < 1)>>
+		<<set $args[0].currentRules = []>>
 	<</if>>
-<</if>>
 
-<<switch _currentRule.activation>>
-<<case "custom">>	/* for betterRA */
-	<<set _isActive = parseAndEvaluate(_currentRule.customActivationText, $args[0])>>
-	<<if _isActive>>
-		<<if !ruleApplied($args[0], _currentRule.ID)>>
-			<<set $args[0].currentRules.push(_currentRule.ID)>>
-				<br>Rule _rule (_currentRule.name) is now applying to $args[0].slaveName.
-		<</if>>
-	<<else>>
-		<<if ruleApplied($args[0], _currentRule.ID)>>
-			<<RARemoveRule $args[0]>>
-		<</if>>
-	<</if>>
-<<case "always">>
-	<<if !ruleApplied($args[0], _currentRule.ID)>>
-		<<set $args[0].currentRules.push(_currentRule.ID)>>
-		<br>Rule _rule (_currentRule.name) is now applying to $args[0].slaveName.
-	<</if>>
-<<case "none">>
-	<<if ruleApplied($args[0], _currentRule.ID)>>
-		<<RARemoveRule $args[0]>>
-	<</if>>
-<<case "devotion">>
-	<<if checkThresholds($args[0].devotion, _currentRule)>>
-		<<if !ruleApplied($args[0], _currentRule.ID)>>
-			<<set $args[0].currentRules.push(_currentRule.ID)>>
-			<br>Rule _rule (_currentRule.name) is now applying to $args[0].slaveName.
-		<</if>>
-	<<else>>
-		<<if ruleApplied($args[0], _currentRule.ID)>>
-			<<RARemoveRule $args[0]>>
-		<</if>>
-	<</if>>
-<<case "trust">>
-	<<if checkThresholds($args[0].trust, _currentRule)>>
-		<<if !ruleApplied($args[0], _currentRule.ID)>>
-			<<set $args[0].currentRules.push(_currentRule.ID)>>
-			<br>Rule _rule (_currentRule.name) is now applying to $args[0].slaveName.
-		<</if>>
-	<<else>>
-		<<if ruleApplied($args[0], _currentRule.ID)>>
-			<<RARemoveRule $args[0]>>
-		<</if>>
-	<</if>>
-<<case "health">>
-	<<if ($args[0].assignment == "live with your Head Girl") && ($args[0].health <= 100)>>
-		<<if checkThresholds($args[0].health, _currentRule)>>
-			<<if !ruleApplied($args[0], _currentRule.ID)>>
-			<<set $args[0].currentRules.push(_currentRule.ID)>>
-				<br>Rule _rule (_currentRule.name) is now applying to $args[0].slaveName.
-			<</if>>
-		<<else>>
-			<<if ruleApplied($args[0], _currentRule.ID)>>
-				<<RARemoveRule $args[0]>>
-			<</if>>
-		<</if>>
-	<<elseif $args[0].health <= 90>>
-		<<if checkThresholds($args[0].health, _currentRule)>>
-			<<if !ruleApplied($args[0], _currentRule.ID)>>
-			<<set $args[0].currentRules.push(_currentRule.ID)>>
-				<br>Rule _rule (_currentRule.name) is now applying to $args[0].slaveName.
+	<<for _r = 0; _r < $defaultRules.length; _r++>>
+		<<set _currentRule = $defaultRules[_r], _rule = _r+1, _ruleAppliesToThisSlave = true>> /* starting assumption, to be tested below */
+
+		<<switch _currentRule.activation>> /* check activation conditions */
+			<<case "custom">>	/* for betterRA */
+				<<if ! parseAndEvaluate(_currentRule.customActivationText, $args[0])>>
+					<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
+			<<case "always">>
+				/* _ruleAppliesToThisSlave remains true, but still need to pass inclusion/exclusion checks below */
+			<<case "none">>
+					<<set _ruleAppliesToThisSlave = false>>
+			<<case "devotion">>
+				<<if ! checkThresholds($args[0].devotion, _currentRule)>>
+					<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
+			<<case "trust">>
+				<<if ! checkThresholds($args[0].trust, _currentRule)>>
+					<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
+			<<case "health">>
+				<<if ! checkThresholds($args[0].health, _currentRule)>>
+					<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
+			<<case "sex drive">> /* rule can only be applied if slave's sexuality is known */
+				<<if ($args[0].attrKnown == 0) || ! checkThresholds($args[0].energy, _currentRule)>>
+					<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
+			<<case "age">>
+				<<if ! checkThresholds($args[0].physicalAge, _currentRule)>>
+					<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
+			<<case "weight">>
+				<<if ! checkThresholds($args[0].weight, _currentRule)>>
+					<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
+			<<case "lactation">>
+				<<if ! checkThresholds($args[0].lactation, _currentRule)>>
+					<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
+			<<case "pregnancy week">>
+				<<if ! checkThresholds($args[0].preg, _currentRule)>>
+					<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
+			<<case "pregnancy foetuses">> /* pregnancy only becomes visible after tenth week */
+				<<if $args[0].preg <= 10 || ! checkThresholds($args[0].pregType, _currentRule)>>
+					<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
+			<<case "belly implant volume">>
+				<<if ! checkThresholds($args[0].bellyImplant, _currentRule)>>
+					<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
+		<</switch>> /* closes activation condition checks */
+
+		<<if _ruleAppliesToThisSlave == true>> /* passed activation conditions check - next check inclusion/exclusion rules */
+			<<if   (def _currentRule.excludedSlaves && _currentRule.excludedSlaves.length > 0 && ruleSlaveExcluded($args[0], _currentRule))
+				|| (def _currentRule.selectedSlaves && _currentRule.selectedSlaves.length > 0 && !ruleSlaveSelected($args[0], _currentRule))>>
+					<<set _ruleAppliesToThisSlave = false>>
+			<<elseif $args[0].assignmentVisible == 0>> /* assignment is not visible, so check facilities assignments */
+				<<if   (def _currentRule.excludeFacility && _currentRule.excludeFacility.length > 0 && ruleExcludeSlaveFacility(_currentRule, $args[0]))
+					|| (def _currentRule.facility        && _currentRule.facility.length > 0        && !ruleAppliedToSlaveFacility(_currentRule, $args[0]))>>
+						<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
+			<<else>> /* assignment is visible, so check non-facilities assignments */
+				<<if   (def _currentRule.excludeAssignment && _currentRule.excludeAssignment.length > 0 && ruleAssignment(_currentRule.excludeAssignment, $args[0].assignment))
+					|| (def _currentRule.assignment        && _currentRule.assignment.length > 0        && !ruleAssignment(_currentRule.assignment, $args[0].assignment))>>
+						<<set _ruleAppliesToThisSlave = false>>
+				<</if>>
 			<</if>>
-		<<else>>
-			<<if ruleApplied($args[0], _currentRule.ID)>>
-				<<RARemoveRule $args[0]>>
+		<</if>> /* done with all checks for this rule */
+
+		<<if _ruleAppliesToThisSlave == true>>
+			<<if !ruleApplied($args[0], _currentRule.ID)>> /* rule applies now, but did not apply before */
+				<<set $args[0].currentRules.push(_currentRule.ID)>>
+				<br>//@@.tan;Rule _rule (_currentRule.name) is now applying to $args[0].slaveName (current assignment: $args[0].assignment).@@//
 			<</if>>
+			/* this rule has been applied to this slave now (or was already), so we are done with this rule */
+		<<elseif ruleApplied($args[0], _currentRule.ID)>> /* rule does not apply now, but did before */
+			<<RARemoveRule $args[0]>> /* RARemoveRule prints message and includes Rules Facilities Remove check, so we are done with this rule */
 		<</if>>
-	<<else>>
-		<<if ruleApplied($args[0], _currentRule.ID)>>
-			<<RARemoveRule $args[0]>>
-		<</if>>
-	<</if>>
-<<case "sex drive">>
-	<<if checkThresholds($args[0].energy, _currentRule)>>
-		<<if ($args[0].attrKnown == 1) && (ruleApplied($args[0], _currentRule.ID) == false)>>
-			<<set $args[0].currentRules.push(_currentRule.ID)>>
-			<br>Rule _rule (_currentRule.name) is now applying to $args[0].slaveName.
-		<</if>>
-	<<else>>
-		<<if ruleApplied($args[0], _currentRule.ID)>>
-			<<RARemoveRule $args[0]>>
-		<</if>>
-	<</if>>
-<<case "age">>
-	<<if checkThresholds($args[0].physicalAge, _currentRule)>>
-		<<if !ruleApplied($args[0], _currentRule.ID)>>
-			<<set $args[0].currentRules.push(_currentRule.ID)>>
-			<br>Rule _rule (_currentRule.name) is now applying to $args[0].slaveName.
-		<</if>>
-	<<else>>
-		<<if ruleApplied($args[0], _currentRule.ID)>>
-			<<RARemoveRule $args[0]>>
-		<</if>>
-	<</if>>
-<<case "weight">>
-	<<if checkThresholds($args[0].weight, _currentRule)>>
-		<<if !ruleApplied($args[0], _currentRule.ID)>>
-			<<set $args[0].currentRules.push(_currentRule.ID)>>
-			<br>Rule _rule (_currentRule.name) is now applying to $args[0].slaveName.
-		<</if>>
-	<<else>>
-		<<if ruleApplied($args[0], _currentRule.ID)>>
-			<<RARemoveRule $args[0]>>
-		<</if>>
-	<</if>>
-<<case "lactation">>
-	<<if checkThresholds($args[0].lactation, _currentRule)>>
-		<<if !ruleApplied($args[0], _currentRule.ID)>>
-			<<set $args[0].currentRules.push(_currentRule.ID)>>
-		<</if>>
-	<<else>>
-		<<if ruleApplied($args[0], _currentRule.ID)>>
-			<<set $dump = $args[0].currentRules.pluck([_r])>>
-			<<include "Rules Facility Remove">>
-			<<continue>>
-		<</if>>
-	<</if>>
-<<case "pregnancy week">>
-	<<if checkThresholds($args[0].preg, _currentRule)>>
-		<<if !ruleApplied($args[0], _currentRule.ID)>>
-			<<set $args[0].currentRules.push(_currentRule.ID)>>
-		<</if>>
-	<<else>>
-		<<if ruleApplied($args[0], _currentRule.ID)>>
-			<<set $dump = $args[0].currentRules.pluck([_r])>>
-			<<include "Rules Facility Remove">>
-			<<continue>>
-		<</if>>
-	<</if>>
-<<case "pregnancy foetuses">>
-	<<if (checkThresholds($args[0].pregType, _currentRule) && $args[0].preg > 10)>>
-		<<if !ruleApplied($args[0], _currentRule.ID)>>
-			<<set $args[0].currentRules.push(_currentRule.ID)>>
-		<</if>>
-	<<else>>
-		<<if ruleApplied($args[0], _currentRule.ID)>>
-			<<set $dump = $args[0].currentRules.pluck([_r])>>
-			<<include "Rules Facility Remove">>
-			<<continue>>
-		<</if>>
-	<</if>>
-<<case "belly implant volume">>
-	<<if checkThresholds($args[0].bellyImplant, _currentRule)>>
-		<<if !ruleApplied($args[0], _currentRule.ID)>>
-			<<set $args[0].currentRules.push(_currentRule.ID)>>
-		<</if>>
-	<<else>>
-		<<if ruleApplied($args[0], _currentRule.ID)>>
-			<<set $dump = $args[0].currentRules.pluck([_r])>>
-			<<include "Rules Facility Remove">>
-			<<continue>>
-		<</if>>
-	<</if>>
-<</switch>>
-<</for>>
+	<</for>> /* done with this rule - continue looping through all the rules defined in the rules assistant */
+
+	/* done checking/applying/removing rules - sort this slave's updated applied rules to match the current priority order in the rules assistant */
+	<<set $args[0].currentRules = $args[0].currentRules.sort(function(a, b) { return a-b; });>> /* sort this slave's applied rules to match the current priority order in the rules assistant */
 
-<<set $args[0].currentRules = $args[0].currentRules.sort(function(a, b) { return a-b; });>>
 <</widget>>
+