diff --git a/src/SecExp/attackHandler.tw b/src/SecExp/attackHandler.tw
index 969309e85a6b6ec0a1bfd4d404a04fcfab30c47a..1b704c89678592bcc429672518e407844d211305 100644
--- a/src/SecExp/attackHandler.tw
+++ b/src/SecExp/attackHandler.tw
@@ -22,31 +22,43 @@
 	<</if>>
 <</for>>
 
-<<if $battleResult == 1>>	/* bribery check */
-	<<if $showBattleStatistics == 1>>bribery chosen<</if>>
-	<<if $cash >= $bribeCost>>						/* if there's enough cash there's a 10% chance bribery fails. If there isn't there's instead a 50% chance it fails */
-		<<if random(1,100) <= 10>>
-			<<set $battleResult = 0>>
-		<</if>>
+<<if $battleResult == 1 || $battleResult == -1>>	/* bribery/surrender check */
+	<<if $showBattleStatistics == 1>>
+		bribery chosen
 	<<else>>
-		<<if random(1,100) <= 50>>
-			<<set $battleResult = 0>>
-		<</if>>
+		Surrender chosen
 	<</if>>
-	<<if $showBattleStatistics == 1>>
-		<<if $battleResult == 0>>
-			<br>Bribery failed!
+	<<if $battleResult == 1>>
+		<<if $cash >= $bribeCost>>						/* if there's enough cash there's a 10% chance bribery fails. If there isn't there's instead a 50% chance it fails */
+			<<if $attackType == "freedom fighters">>
+				<<if random(1,100) <= 50>>
+					<<set $battleResult = 0>>
+				<</if>>
+			<<elseif random(1,100) <= 10>>
+				<<set $battleResult = 0>>
+			<</if>>
 		<<else>>
-			<br>Bribery Successful!
+			<<if random(1,100) <= 50>>
+				<<set $battleResult = 0>>
+			<</if>>
 		<</if>>
-		<br><br>
-		<<link "proceed">>
+		<<if $showBattleStatistics == 1>>
+			<<if $battleResult == 0>>
+				<br>Bribery failed!
+			<<else>>
+				<br>Bribery Successful!
+			<</if>>
+			<br><br>
+			<<link "proceed">>
+				<<goto "attackReport">>
+			<</link>>
+		<<else>>
 			<<goto "attackReport">>
-		<</link>>
+		<</if>>
 	<<else>>
 		<<goto "attackReport">>
 	<</if>>
-
+	
 <<else>>
 
 /*Init*/
diff --git a/src/SecExp/attackReport.tw b/src/SecExp/attackReport.tw
index d73903db7fef444cc81df628d5bff7dee11dc247..a76f5f7263205ebf9f404cde652bd0d2bae5cae6 100644
--- a/src/SecExp/attackReport.tw
+++ b/src/SecExp/attackReport.tw
@@ -131,7 +131,7 @@
 
 <<if $attackType == "raiders">>
 	Today, the _day of _month _year, our arcology was attacked by a band of wild raiders, $attackTroops men strong.
-	<<if $battleResult != 1 || $battleResult != 0 || $battleResult != -1>>
+	<<if $battleResult != 1 && $battleResult != 0 && $battleResult != -1>>
 		Our defense forces, $troopCount strong, clashed with them
 		<<if $battleTerrain == "urban">>
 			in the streets of <<if $terrain == "urban">>the old world city surrounding the arcology<<else>>of the free city<</if>>,
@@ -149,9 +149,9 @@
 			in the wastelands outside the free city territory,
 		<</if>>
 		<<if $enemyLosses != $attackTroops>>
-			inflicting <<print $enemyLosses>> casualties, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<else>> a casualty<</if>> themselves.
+			inflicting <<print $enemyLosses>> casualties, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<elseif $losses > 0>> a casualty <<else>> zero <</if>> themselves.
 		<<else>>
-			completely annihilating their troops, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<else>> a casualty.<</if>>.
+			completely annihilating their troops, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties. <<elseif $losses > 0>> a casualty. <<else>> zero casualties.<</if>>
 		<</if>>
 	<</if>>
 	<<if $battleResult == 3>>
@@ -197,7 +197,7 @@
 	<</if>>
 <<elseif $attackType == "free city">>
 	Today, the _day of _month _year, our arcology was attacked by a contingent of mercenaries hired by a competing free city, $attackTroops men strong.
-	<<if $battleResult != 1 || $battleResult != 0 || $battleResult != -1>>
+	<<if $battleResult != 1 && $battleResult != 0 && $battleResult != -1>>
 		Our defense forces, $troopCount strong, clashed with them
 		<<if $battleTerrain == "urban">>
 			in the streets of <<if $terrain == "urban">>the old world city surrounding the arcology<<else>>of the free city<</if>>,
@@ -215,9 +215,9 @@
 			in the wastelands outside the free city territory,
 		<</if>>
 		<<if $enemyLosses != $attackTroops>>
-			inflicting <<print $enemyLosses>> casualties, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<else>> a casualty<</if>> themselves.
+			inflicting <<print $enemyLosses>> casualties, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<elseif $losses > 0>> a casualty <<else>> zero <</if>> themselves.
 		<<else>>
-			completely annihilating their troops, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<else>> a casualty.<</if>>.
+			completely annihilating their troops, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<elseif $losses > 0>> a casualty .<<else>> zero casualties.<</if>>
 		<</if>>
 	<</if>>
 	<<if $battleResult == 3>>
@@ -263,7 +263,7 @@
 	<</if>>
 <<elseif $attackType == "freedom fighters">>
 	Today, the _day of _month _year, our arcology was attacked by a group of freedom fighters bent on the destruction of the institution of slavery, $attackTroops men strong.
-	<<if $battleResult != 1 || $battleResult != 0 || $battleResult != -1>>
+	<<if $battleResult != 1 && $battleResult != 0 && $battleResult != -1>>
 		Our defense forces, $troopCount strong, clashed with them
 		<<if $battleTerrain == "urban">>
 			in the streets of <<if $terrain == "urban">>the old world city surrounding the arcology<<else>>of the free city<</if>>,
@@ -281,9 +281,9 @@
 			in the wastelands outside the free city territory,
 		<</if>>
 		<<if $enemyLosses != $attackTroops>>
-			inflicting <<print $enemyLosses>> casualties, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<else>> a casualty<</if>> themselves.
+			inflicting <<print $enemyLosses>> casualties, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<elseif $losses > 0>> a casualty <<else>> zero <</if>> themselves.
 		<<else>>
-			completely annihilating their troops, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<else>> a casualty.<</if>>.
+			completely annihilating their troops, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<elseif $losses > 0>> a casualty. <<else>> zero casualties.<</if>>
 		<</if>>
 	<</if>>
 	<<if $battleResult == 3>>
@@ -329,7 +329,7 @@
 	<</if>>
 <<elseif $attackType == "old world">>
 	Today, the _day of _month _year, our arcology was attacked by an old world nation boasting a misplaced sense of superiority, $attackTroops men strong.
-	<<if $battleResult != 1 || $battleResult != 0 || $battleResult != -1>>
+	<<if $battleResult != 1 && $battleResult != 0 && $battleResult != -1>>
 		Our defense forces, $troopCount strong, clashed with them
 		<<if $battleTerrain == "urban">>
 			in the streets of <<if $terrain == "urban">>the old world city surrounding the arcology<<else>>of the free city<</if>>,
@@ -347,9 +347,9 @@
 			in the wastelands outside the free city territory,
 		<</if>>
 		<<if $enemyLosses != $attackTroops>>
-			inflicting <<print $enemyLosses>> casualties, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<else>> a casualty<</if>> themselves.
+			inflicting <<print $enemyLosses>> casualties, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<elseif $losses > 0>> a casualty <<else>> zero <</if>> themselves.
 		<<else>>
-			completely annihilating their troops, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<else>> a casualty.<</if>>.
+			completely annihilating their troops, while sustaining <<if $losses > 1>> <<print commaNum(Math.trunc($losses))>> casualties <<<elseif $losses > 0>> a casualty. <<else>> zero casualties.<</if>>
 		<</if>>
 	<</if>>
 	<<if $battleResult == 3>>
@@ -677,10 +677,18 @@
 	<<set $cash -= $bribeCost>>
 <</if>>
 <<if !isInt($ACitizens)>>
-	<br>@@.red;Error: ACitizens is Nan, please report this issue@@
+	<<if isNaN($ACitizens)>>
+		<br>@@.red;Error: ACitizens is NaN, please report this issue@@
+	<<else>>
+		<<set $ACitizens = Math.clamp(Math.trunc($ACitizens),100,$ACitizenLimit)>>
+	<</if>>
 <</if>>
 <<if !isInt($ASlaves)>>
-	<br>@@.red;Error: ASlaves is Nan, please report this issue@@
+	<<if isNaN($ASlaves)>>
+		<br>@@.red;Error: ASlaves is NaN, please report this issue@@
+	<<else>>
+		<<set $ASlaves = Math.clamp(Math.trunc($ASlaves),1000,$ASlaveLimit)>>
+	<</if>>
 <</if>>
 
 <br><br>
diff --git a/src/SecExp/rebellionGenerator.tw b/src/SecExp/rebellionGenerator.tw
index 3134e57c7064ce5e2f2c0ba88d5965af1d3da39c..8f2a024cabb3e2165418e4580ac22ec42c774f86 100644
--- a/src/SecExp/rebellionGenerator.tw
+++ b/src/SecExp/rebellionGenerator.tw
@@ -2,7 +2,7 @@
 
 <<set _slave = 0>>
 <<set _citizen = 0>>
-<<set _CSratio = $ACitizens / $ASlaves>>
+<<set _CSratio = $ACitizens / ($ASlaves + $helots)>>
 
 <strong>Slaves security analysis:</strong>
 <<if $authority <= 3000>>
diff --git a/src/SecExp/securityReport.tw b/src/SecExp/securityReport.tw
index a872ab77b268885318b1e0df46b4d42ffa786b0a..b3b38ffbf1ad036581c5d56f389b87e44966718e 100644
--- a/src/SecExp/securityReport.tw
+++ b/src/SecExp/securityReport.tw
@@ -356,6 +356,7 @@
 		<<else>>
 			There are not many more citizens able to join the arcology armed forces. You'll need to enact higher recruitment edicts if you need more manpower.
 		<</if>>
+		<br>
 	<</if>>
 
 	/* mercs */
@@ -396,129 +397,132 @@
 			<<set $mercTotalManpower -= $mercFreeManpower - 2000>>
 			<<set $mercFreeManpower = 2000>>
 		<</if>>
-	<</if>>
-	<br>
-	/* loyalty and training */
-	<<set _sL = $slaveUnits.length>>
-	<<for _i = 0; _i < _sL; _i++>>
-		<<set _loyaltyChange = 0>>
 		<br>
-		<br> $slaveUnits[_i].platoonName:
-		<<if $secBarracksUpgrades.loyaltyMod >= 1>>
-			<<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>>
-			is periodically sent to the indoctrination facility in the barracks for thought correction therapy.
-		<</if>>
-		<<if $slaveUnits[_i].commissars >= 1>>
-			The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination.
-			<<set _loyaltyChange += 2 * $slaveUnits[_i].commissars>>
-		<</if>>
-		<<if $soldierWages == 2>>
-			The slaves greatly appreciate the generous wage given to them for their service as soldiers. Occasions to earn money for a slave are scarce after all.
-			<<set _loyaltyChange += random(5,10)>>
-		<<elseif $soldierWages == 1>>
-			The slaves appreciate the wage given to them for their service as soldiers, despite it being just adequate. Occasions to earn money for a slave are scarce after all.
-			<<set _loyaltyChange += random(-5,5)>>
-		<<else>>
-			The slaves do not appreciate the low wage given to them for their service as soldiers, but occasions to earn money for a slave are scarce, so they're not too affected by it.
-			<<set _loyaltyChange -= random(5,10)>>
-		<</if>>
-		<<if $slaveSoldierPrivilege == 1>>
-			Allowing them to hold material possessions earns you their devotion and loyalty.
-			<<set _loyaltyChange += random(1,2)>>
-		<</if>>
-		<<if _loyaltyChange > 0>>
-			The loyalty of this unit @@.green;increased@@ this week.
-		<<elseif _loyaltyChange == 0>>
-			The loyalty of this unit @@.yellow;did not change@@ this week.
-		<<else>>
-			The loyalty of this unit @@.red;decreased@@ this week.
-		<</if>>
-		<<set $slaveUnits[_i].loyalty = Math.clamp($slaveUnits[_i].loyalty + _loyaltyChange,0,100)>>
-		<<if $slaveUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>>
-			<br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
-			<<set $slaveUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>>
-		<</if>>
-	<</for>>
-	<<set _mL = $militiaUnits.length>>
-	<<for _i = 0; _i < _mL; _i++>>
-		<br>
-		<br>$militiaUnits[_i].platoonName:
-		<<set _loyaltyChange = 0>>
-		<<if $secBarracksUpgrades.loyaltyMod >= 1>>
-			<<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>>
-			is periodically sent to the indoctrination facility in the barracks for thought correction therapy.
-		<</if>>
-		<<if $militiaUnits[_i].commissars >= 1>>
-			The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination.
-			<<set _loyaltyChange += 2 * $militiaUnits[_i].commissars>>
-		<</if>>
-		<<if $soldierWages == 2>>
-			The soldiers greatly appreciate the generous wage given to them for their service. They are proud to defend their homes while making a small fortune out of it.
-			<<set _loyaltyChange += random(5,10)>>
-		<<elseif $soldierWages == 1>>
-			The soldiers appreciate the wage given to them for their service, despite it being just adequate. They are proud to defend their homes, though at the cost of possible financial gains.
-			<<set _loyaltyChange += random(-5,5)>>
-		<<else>>
-			The soldiers do not appreciate the low wage given to them for their service. Their sense of duty keeps them proud of their role as defenders of the arcology, but many do feel its financial weight.
-			<<set _loyaltyChange -= random(5,10)>>
-		<</if>>
-		<<if $militiaSoldierPrivilege == 1>>
-			Allowing them to avoid rent payment for their military service earns you their happiness and loyalty.
-			<<set _loyaltyChange += random(1,2)>>
-		<</if>>
-		<<if _loyaltyChange > 0>>
-			The loyalty of this unit @@.green;increased@@ this week.
-		<<elseif _loyaltyChange == 0>>
-			The loyalty of this unit @@.yellow;did not change@@ this week.
-		<<else>>
-			The loyalty of this unit @@.red;decreased@@ this week.
-		<</if>>
-		<<set $militiaUnits[_i].loyalty = Math.clamp($militiaUnits[_i].loyalty + _loyaltyChange,0,100)>>
-		<<if $militiaUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>>
-			<br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
-			<<set $militiaUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>>
-		<</if>>
-	<</for>>
-	<<set _meL = $mercUnits.length>>
-	<<for _i = 0; _i < _meL; _i++>>
-		<br>
-		<br>$mercUnits[_i].platoonName:
-		<<set _loyaltyChange = 0>>
-		<<if $secBarracksUpgrades.loyaltyMod >= 1>>
-			<<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>>
-			is periodically sent to the indoctrination facility in the barracks for thought correction therapy.
-		<</if>>
-		<<if $mercUnits[_i].commissars >= 1>>
-			The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination.
-			<<set _loyaltyChange += 2 * $mercUnits[_i].commissars>>
-		<</if>>
-		<<if $soldierWages == 2>>
-			The mercenaries greatly appreciate the generous wage given to them for their service. After all coin is the fastest way to reach their hearts.
-			<<set _loyaltyChange += random(5,10)>>
-		<<elseif $soldierWages == 1>>
-			The mercenaries do not appreciate the barely adequate wage given to them for their service. Still their professionalism keeps them determined to finish their contract.
-			<<set _loyaltyChange += random(-5,5)>>
-		<<else>>
-			The mercenaries do not appreciate the low wage given to them for their service.Their skill would be better served by a better contract and this world does not lack demand for guns for hire.
-			<<set _loyaltyChange -= random(5,10)>>
-		<</if>>
-		<<if $mercSoldierPrivilege == 1>>
-			Allowing them to keep part of the loot gained from your enemies earns you their trust and loyalty.
-			<<set _loyaltyChange += random(1,2)>>
-		<</if>>
-		<<if _loyaltyChange > 0>>
-			The loyalty of this unit @@.green;increased@@ this week.
-		<<elseif _loyaltyChange == 0>>
-			The loyalty of this unit @@.yellow;did not change@@ this week.
-		<<else>>
-			The loyalty of this unit @@.red;decreased@@ this week.
-		<</if>>
-		<<set $mercUnits[_i].loyalty = Math.clamp($mercUnits[_i].loyalty + _loyaltyChange,0,100)>>
-		<<if $mercUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>>
-			<br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
-			<<set $mercUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>>
-		<</if>>
-	<</for>>
+	<</if>>
+	
+	<<if $activeUnits > 0>>
+		/* loyalty and training */
+		<<set _sL = $slaveUnits.length>>
+		<<for _i = 0; _i < _sL; _i++>>
+			<<set _loyaltyChange = 0>>
+			<br>
+			<br> $slaveUnits[_i].platoonName:
+			<<if $secBarracksUpgrades.loyaltyMod >= 1>>
+				<<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>>
+				is periodically sent to the indoctrination facility in the barracks for thought correction therapy.
+			<</if>>
+			<<if $slaveUnits[_i].commissars >= 1>>
+				The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination.
+				<<set _loyaltyChange += 2 * $slaveUnits[_i].commissars>>
+			<</if>>
+			<<if $soldierWages == 2>>
+				The slaves greatly appreciate the generous wage given to them for their service as soldiers. Occasions to earn money for a slave are scarce after all.
+				<<set _loyaltyChange += random(5,10)>>
+			<<elseif $soldierWages == 1>>
+				The slaves appreciate the wage given to them for their service as soldiers, despite it being just adequate. Occasions to earn money for a slave are scarce after all.
+				<<set _loyaltyChange += random(-5,5)>>
+			<<else>>
+				The slaves do not appreciate the low wage given to them for their service as soldiers, but occasions to earn money for a slave are scarce, so they're not too affected by it.
+				<<set _loyaltyChange -= random(5,10)>>
+			<</if>>
+			<<if $slaveSoldierPrivilege == 1>>
+				Allowing them to hold material possessions earns you their devotion and loyalty.
+				<<set _loyaltyChange += random(1,2)>>
+			<</if>>
+			<<if _loyaltyChange > 0>>
+				The loyalty of this unit @@.green;increased@@ this week.
+			<<elseif _loyaltyChange == 0>>
+				The loyalty of this unit @@.yellow;did not change@@ this week.
+			<<else>>
+				The loyalty of this unit @@.red;decreased@@ this week.
+			<</if>>
+			<<set $slaveUnits[_i].loyalty = Math.clamp($slaveUnits[_i].loyalty + _loyaltyChange,0,100)>>
+			<<if $slaveUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>>
+				<br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
+				<<set $slaveUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>>
+			<</if>>
+		<</for>>
+		<<set _mL = $militiaUnits.length>>
+		<<for _i = 0; _i < _mL; _i++>>
+			<br>
+			<br>$militiaUnits[_i].platoonName:
+			<<set _loyaltyChange = 0>>
+			<<if $secBarracksUpgrades.loyaltyMod >= 1>>
+				<<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>>
+				is periodically sent to the indoctrination facility in the barracks for thought correction therapy.
+			<</if>>
+			<<if $militiaUnits[_i].commissars >= 1>>
+				The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination.
+				<<set _loyaltyChange += 2 * $militiaUnits[_i].commissars>>
+			<</if>>
+			<<if $soldierWages == 2>>
+				The soldiers greatly appreciate the generous wage given to them for their service. They are proud to defend their homes while making a small fortune out of it.
+				<<set _loyaltyChange += random(5,10)>>
+			<<elseif $soldierWages == 1>>
+				The soldiers appreciate the wage given to them for their service, despite it being just adequate. They are proud to defend their homes, though at the cost of possible financial gains.
+				<<set _loyaltyChange += random(-5,5)>>
+			<<else>>
+				The soldiers do not appreciate the low wage given to them for their service. Their sense of duty keeps them proud of their role as defenders of the arcology, but many do feel its financial weight.
+				<<set _loyaltyChange -= random(5,10)>>
+			<</if>>
+			<<if $militiaSoldierPrivilege == 1>>
+				Allowing them to avoid rent payment for their military service earns you their happiness and loyalty.
+				<<set _loyaltyChange += random(1,2)>>
+			<</if>>
+			<<if _loyaltyChange > 0>>
+				The loyalty of this unit @@.green;increased@@ this week.
+			<<elseif _loyaltyChange == 0>>
+				The loyalty of this unit @@.yellow;did not change@@ this week.
+			<<else>>
+				The loyalty of this unit @@.red;decreased@@ this week.
+			<</if>>
+			<<set $militiaUnits[_i].loyalty = Math.clamp($militiaUnits[_i].loyalty + _loyaltyChange,0,100)>>
+			<<if $militiaUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>>
+				<br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
+				<<set $militiaUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>>
+			<</if>>
+		<</for>>
+		<<set _meL = $mercUnits.length>>
+		<<for _i = 0; _i < _meL; _i++>>
+			<br>
+			<br>$mercUnits[_i].platoonName:
+			<<set _loyaltyChange = 0>>
+			<<if $secBarracksUpgrades.loyaltyMod >= 1>>
+				<<set _loyaltyChange += 2 * $secBarracksUpgrades.loyaltyMod>>
+				is periodically sent to the indoctrination facility in the barracks for thought correction therapy.
+			<</if>>
+			<<if $mercUnits[_i].commissars >= 1>>
+				The commissars attached to the unit carefully monitor the officers and grunts for signs of insubordination.
+				<<set _loyaltyChange += 2 * $mercUnits[_i].commissars>>
+			<</if>>
+			<<if $soldierWages == 2>>
+				The mercenaries greatly appreciate the generous wage given to them for their service. After all coin is the fastest way to reach their hearts.
+				<<set _loyaltyChange += random(5,10)>>
+			<<elseif $soldierWages == 1>>
+				The mercenaries do not appreciate the barely adequate wage given to them for their service. Still their professionalism keeps them determined to finish their contract.
+				<<set _loyaltyChange += random(-5,5)>>
+			<<else>>
+				The mercenaries do not appreciate the low wage given to them for their service.Their skill would be better served by a better contract and this world does not lack demand for guns for hire.
+				<<set _loyaltyChange -= random(5,10)>>
+			<</if>>
+			<<if $mercSoldierPrivilege == 1>>
+				Allowing them to keep part of the loot gained from your enemies earns you their trust and loyalty.
+				<<set _loyaltyChange += random(1,2)>>
+			<</if>>
+			<<if _loyaltyChange > 0>>
+				The loyalty of this unit @@.green;increased@@ this week.
+			<<elseif _loyaltyChange == 0>>
+				The loyalty of this unit @@.yellow;did not change@@ this week.
+			<<else>>
+				The loyalty of this unit @@.red;decreased@@ this week.
+			<</if>>
+			<<set $mercUnits[_i].loyalty = Math.clamp($mercUnits[_i].loyalty + _loyaltyChange,0,100)>>
+			<<if $mercUnits[_i].training < 100 && $secBarracksUpgrades.training >= 1>>
+				<br>The unit is able to make use of the training facilities to better prepare its soldiers, slowing increasing their experience level.
+				<<set $mercUnits[_i].training += random(2,4) * 1.5 * $secBarracksUpgrades.training>>
+			<</if>>
+		<</for>>
+	<</if>>
 <</if>>