From a70772afbc3270eab2e6728ed5609fa71946cd05 Mon Sep 17 00:00:00 2001
From: kopareigns <kopareigns@gmail.com>
Date: Sun, 10 Jun 2018 16:31:22 -0400
Subject: [PATCH] Fix

---
 src/uncategorized/corporationDevelopments.tw | 434 +++++++++----------
 1 file changed, 214 insertions(+), 220 deletions(-)

diff --git a/src/uncategorized/corporationDevelopments.tw b/src/uncategorized/corporationDevelopments.tw
index cb246e00c89..94df888fe15 100644
--- a/src/uncategorized/corporationDevelopments.tw
+++ b/src/uncategorized/corporationDevelopments.tw
@@ -159,175 +159,173 @@ You hold <<print commaNum($personalShares)>> shares valued at @@.yellowgreen;<<p
 
 	<br>Sell personal shares:
 	<<if $personalShares-1000 > $publicShares>>
-				<<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">>
-					<<set $personalShares -= 1000>>
-					<<set $publicShares += 1000>>
-					<<set $cash += 1000*$sharePrice>>
-					<<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>>
-					<<replace "#CorpAction">>
-						<br> <<print "You sold <<print commaNum(1000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">>
-					<</replace>>
-				<</link>>
-		<</if>>
+		<<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">>
+			<<set $personalShares -= 1000>>
+			<<set $publicShares += 1000>>
+			<<set $cash += 1000*$sharePrice>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "You sold <<print commaNum(1000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">>
+			<</replace>>
+		<</link>>
 		<<if $personalShares-5000 > $publicShares>>
-				| <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">>
-					<<set $personalShares -= 5000>>
-					<<set $publicShares += 5000>>
-					<<set $cash += 5000*$sharePrice>>
-					<<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>>
-					<<replace "#CorpAction">>
-						<br> <<print "You sold <<print commaNum(5000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">>
-					<</replace>>
-				<</link>>
+			| <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">>
+				<<set $personalShares -= 5000>>
+				<<set $publicShares += 5000>>
+				<<set $cash += 5000*$sharePrice>>
+				<<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>>
+				<<replace "#CorpAction">>
+					<br> <<print "You sold <<print commaNum(5000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">>
+				<</replace>>
+			<</link>>
 		<</if>>
 		<<if $personalShares-10000 > $publicShares>>
-				| <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">> <<set $personalShares -= 10000>>
-					<<set $publicShares += 10000>>
-					<<set $cash += 10000*$sharePrice>>
-					<<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>>
-					<<replace "#CorpAction">>
-						<br> <<print "You sold <<print commaNum(10000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(10000*$sharePrice))>>@@" driving the share price down slightly.">>
-					<</replace>>
-				<</link>>
+			| <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">> <<set $personalShares -= 10000>>
+				<<set $publicShares += 10000>>
+				<<set $cash += 10000*$sharePrice>>
+				<<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>>
+				<<replace "#CorpAction">>
+					<br> <<print "You sold <<print commaNum(10000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(10000*$sharePrice))>>@@" driving the share price down slightly.">>
+				<</replace>>
+			<</link>>
 		<</if>>
 		<<if $personalShares-15000 > $publicShares>>
-				| <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">>
-					<<set $personalShares -= 15000>>
-					<<set $publicShares += 15000>>
-					<<set $cash += 15000*$sharePrice>>
-					<<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>>
-					<<replace "#CorpAction">>
-						<br> <<print "You sold <<print commaNum(15000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@ driving the share price down somewhat.">>
-					<</replace>>
-				<</link>>
+			| <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">>
+				<<set $personalShares -= 15000>>
+				<<set $publicShares += 15000>>
+				<<set $cash += 15000*$sharePrice>>
+				<<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>>
+				<<replace "#CorpAction">>
+					<br> <<print "You sold <<print commaNum(15000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@ driving the share price down somewhat.">>
+				<</replace>>
+			<</link>>
 		<</if>>
 		<<if $personalShares-20000 > $publicShares>>
-				| <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">>
-					<<set $personalShares -= 20000>>
-					<<set $publicShares += 20000>>
-					<<set $cash += 20000*$sharePrice>>
-					<<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>>
-					<<replace "#CorpAction">>
-						<br> <<print "You sold <<print commaNum(20000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@ driving the share price down significantly.">>
-					<</replace>>
-				<</link>>
+			| <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">>
+				<<set $personalShares -= 20000>>
+				<<set $publicShares += 20000>>
+				<<set $cash += 20000*$sharePrice>>
+				<<set $sharePrice = (Math.trunc($sharePrice*either(98,99,$PC.trading >= 100 ? 99 : 98)))/100>>
+				<<replace "#CorpAction">>
+					<br> <<print "You sold <<print commaNum(20000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@ driving the share price down significantly.">>
+				<</replace>>
+			<</link>>
 		<</if>>
 	<<else>>
 		//You cannot give up majority control.//
 	<</if>>
 
-		<br>Issue new public shares:
-		<<if $personalShares-1000 > $publicShares>>
-				<<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">>
-					<<set $publicShares += 1000>>
-					<<set $corpCash += 1000*Math.ceil($sharePrice)>>
-					<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
-					<<replace "#CorpAction">>
-						<br> <<print "The corporation issued <<print commaNum(1000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">>
-					<</replace>>
-				<</link>>
-		<</if>>
+	<br>Issue new public shares:
+	<<if $personalShares-1000 > $publicShares>>
+		<<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">>
+			<<set $publicShares += 1000>>
+			<<set $corpCash += 1000*Math.ceil($sharePrice)>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "The corporation issued <<print commaNum(1000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">>
+			<</replace>>
+		<</link>>
 		<<if $personalShares-5000 > $publicShares>>
-				| <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">>
-					<<set $publicShares += 5000>>
-					<<set $corpCash += 5000*Math.ceil($sharePrice)>>
-					<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
-					<<replace "#CorpAction">>
-						<br> <<print "The corporation issued <<print commaNum(5000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">>
-					<</replace>>
-				<</link>>
+			| <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">>
+				<<set $publicShares += 5000>>
+				<<set $corpCash += 5000*Math.ceil($sharePrice)>>
+				<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
+				<<replace "#CorpAction">>
+					<br> <<print "The corporation issued <<print commaNum(5000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>> for @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@" driving the share price down slightly.">>
+				<</replace>>
+			<</link>>
 		<</if>>
 		<<if $personalShares-10000 > $publicShares>>
-				| <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">>
-					<<set $publicShares += 10000>>
-					<<set $corpCash += 10000*Math.ceil($sharePrice)>>
-					<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
-					<<replace "#CorpAction">>
-						<br> <<print "The corporation issued <<print commaNum(10000)>> new sharesfor @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@ driving the share price down slightly.">>
-					<</replace>>
-				<</link>>
+			| <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">>
+				<<set $publicShares += 10000>>
+				<<set $corpCash += 10000*Math.ceil($sharePrice)>>
+				<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
+				<<replace "#CorpAction">>
+					<br> <<print "The corporation issued <<print commaNum(10000)>> new sharesfor @@.yellowgreen;<<print cashFormat(Math.ceil(1000*$sharePrice))>>@@ driving the share price down slightly.">>
+				<</replace>>
+			<</link>>
 		<</if>>
 		<<if $personalShares-15000 > $publicShares>>
-				| <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">>
-					<<set $publicShares += 15000>>
-					<<set $corpCash += 15000*Math.ceil($sharePrice)>>
-					<<set $sharePrice = (Math.trunc($sharePrice*random(96,98)))/100>>
-					<<replace "#CorpAction">>
-						<br> <<print "The corporation issued <<print commaNum(15000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@ driving the share price down somewhat.">>
-					<</replace>>
-				<</link>>
+			| <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">>
+				<<set $publicShares += 15000>>
+				<<set $corpCash += 15000*Math.ceil($sharePrice)>>
+				<<set $sharePrice = (Math.trunc($sharePrice*random(96,98)))/100>>
+				<<replace "#CorpAction">>
+					<br> <<print "The corporation issued <<print commaNum(15000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@ driving the share price down somewhat.">>
+				<</replace>>
+			<</link>>
 		<</if>>
 		<<if $personalShares-20000 > $publicShares>>
-				| <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">> <<set $publicShares += 15000>>
-					<<set $corpCash += 20000*Math.ceil($sharePrice)>>
-					<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
-					<<replace "#CorpAction">>
-						<br> <<print "The corporation issued <<print commaNum(20000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@ driving the share price down significantly.">>
-					<</replace>>
-				<</link>>
+			| <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">> <<set $publicShares += 15000>>
+				<<set $corpCash += 20000*Math.ceil($sharePrice)>>
+				<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
+				<<replace "#CorpAction">>
+					<br> <<print "The corporation issued <<print commaNum(20000)>> new shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@ driving the share price down significantly.">>
+				<</replace>>
+			<</link>>
 		<</if>>
 	<<else>>
 		//You cannot give up majority control.//
-	<</if>>/* closes actions that reduce private ownership percentage */
+	<</if>>
+
+<</if>>/* closes actions that reduce private ownership percentage */
 
 <<if _PublicOwnershipPercentage <= 5>><br>//You cannot make the corporation privately held.//
 <<else>> /* actions that reduce public ownership percentage */
 	<br>Purchase shares from corporation:
 	<<if $cash > 1000*$sharePrice>>
-		<<if $cash > 1000*$sharePrice>>
-			 <<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">>
-			 <<set $personalShares += 1000>>
-			 <<set $cash -= 1000*$sharePrice>>
-			 <<set $corpCash += 1000*Math.floor($sharePrice)>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "You purchased <<print commaNum(1000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@, from the corporation driving the share price down slightly.">>
-				<</replace>>
-		 <</link>>
-		<</if>>
+		<<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">>
+			<<set $personalShares += 1000>>
+			<<set $cash -= 1000*$sharePrice>>
+			<<set $corpCash += 1000*Math.floor($sharePrice)>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "You purchased <<print commaNum(1000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@, from the corporation driving the share price down slightly.">>
+			<</replace>>
+		<</link>>
 		<<if $cash > 5000*$sharePrice>>
-			 | <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">>
-			 <<set $personalShares += 5000>>
-			 <<set $cash -= 5000*$sharePrice>>
-			 <<set $corpCash += 5000*Math.floor($sharePrice)>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "You purchased <<print commaNum(5000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@, from the corporation driving the share price down slightly.">>
-				<</replace>>
-		 <</link>>
+			| <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">>
+			<<set $personalShares += 5000>>
+			<<set $cash -= 5000*$sharePrice>>
+			<<set $corpCash += 5000*Math.floor($sharePrice)>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "You purchased <<print commaNum(5000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@, from the corporation driving the share price down slightly.">>
+			<</replace>>
+			<</link>>
 		<</if>>
 		<<if $cash > 10000*$sharePrice>>
-			 | <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">>
-			 <<set $personalShares += 10000>>
-			 <<set $cash -= 10000*$sharePrice>>
-			 <<set $corpCash += 10000*Math.floor($sharePrice)>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "You purchased <<print commaNum(10000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@, from the corporation driving the share price down slightly.">>
-				<</replace>>
-		 <</link>>
+			| <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">>
+			<<set $personalShares += 10000>>
+			<<set $cash -= 10000*$sharePrice>>
+			<<set $corpCash += 10000*Math.floor($sharePrice)>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "You purchased <<print commaNum(10000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@, from the corporation driving the share price down slightly.">>
+			<</replace>>
+			<</link>>
 		<</if>>
 		<<if $cash > 15000*$sharePrice>>
-			 | <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">>
-			 <<set $personalShares += 15000>>
-			 <<set $cash -= 15000*$sharePrice>>
-			 <<set $corpCash += 15000*Math.floor($sharePrice)>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "You purchased <<print commaNum(15000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@, from the corporation driving the share price down somewhat.">>
-				<</replace>>
-		 <</link>>
+			| <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">>
+			<<set $personalShares += 15000>>
+			<<set $cash -= 15000*$sharePrice>>
+			<<set $corpCash += 15000*Math.floor($sharePrice)>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "You purchased <<print commaNum(15000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@, from the corporation driving the share price down somewhat.">>
+			<</replace>>
+			<</link>>
 		<</if>>
 		<<if $cash > 20000*$sharePrice>>
-			 | <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">>
-			 <<set $personalShares += 20000>>
-			 <<set $cash -= 20000*$sharePrice>>
-			 <<set $corpCash += 20000*Math.floor($sharePrice)>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "You purchased <<print commaNum(20000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@, from the corporation driving the share price down significantly.">>
-				<</replace>>
-		 <</link>>
+			| <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">>
+			<<set $personalShares += 20000>>
+			<<set $cash -= 20000*$sharePrice>>
+			<<set $corpCash += 20000*Math.floor($sharePrice)>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(98,99)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "You purchased <<print commaNum(20000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@, from the corporation driving the share price down significantly.">>
+			<</replace>>
+			<</link>>
 		<</if>>
 	<<else>>
 		//You are unable to purchase <<print commaNum(1000)>> shares at the current share price, valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@.//
@@ -335,56 +333,54 @@ You hold <<print commaNum($personalShares)>> shares valued at @@.yellowgreen;<<p
 
 	<br>Buy publicly held shares:
 	<<if $cash > 1000*$sharePrice && $publicShares > 1000>>
-		<<if $publicShares > 1000 && $cash >= 1000*$sharePrice>>
-			 <<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">>
-			 <<set $personalShares += 1000>>
-			 <<set $publicShares -= 1000>>
-			 <<set $cash -= 1000*$sharePrice>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(101,102,$PC.trading >= 100 ? 101 : 102)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "You bought <<print commaNum(1000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@, driving the share price up slightly.">>
-				<</replace>>
-		 <</link>>
-		<</if>>
+		<<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">>
+			<<set $personalShares += 1000>>
+			<<set $publicShares -= 1000>>
+			<<set $cash -= 1000*$sharePrice>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(101,102,$PC.trading >= 100 ? 101 : 102)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "You bought <<print commaNum(1000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@, driving the share price up slightly.">>
+			<</replace>>
+		<</link>>
 		<<if $publicShares > 5000 && $cash >= 5000*$sharePrice>>
-			 | <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">> <<set $personalShares += 1000>>
-			 <<set $publicShares -= 5000>>
-			 <<set $cash -= 5000*$sharePrice>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(101,102,$PC.trading >= 100 ? 101 : 102)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "You bought <<print commaNum(5000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@, driving the share price up slightly.">>
-				<</replace>>
-		 <</link>>
+			| <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">> <<set $personalShares += 1000>>
+			<<set $publicShares -= 5000>>
+			<<set $cash -= 5000*$sharePrice>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(101,102,$PC.trading >= 100 ? 101 : 102)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "You bought <<print commaNum(5000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@, driving the share price up slightly.">>
+			<</replace>>
+			<</link>>
 		<</if>>
 		<<if $publicShares > 10000 && $cash >= 10000*$sharePrice>>
-			 | <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">> <<set $personalShares += 10000>>
-			 <<set $publicShares -= 10000>>
-			 <<set $cash -= 10000*$sharePrice>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(101,102,$PC.trading >= 100 ? 101 : 102)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "You bought <<print commaNum(10000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@, driving the share price up slightly.">>
-				<</replace>>
-		 <</link>>
+			| <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">> <<set $personalShares += 10000>>
+			<<set $publicShares -= 10000>>
+			<<set $cash -= 10000*$sharePrice>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(101,102,$PC.trading >= 100 ? 101 : 102)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "You bought <<print commaNum(10000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@, driving the share price up slightly.">>
+			<</replace>>
+			<</link>>
 		<</if>>
 		<<if $publicShares > 15000 && $cash >= 15000*$sharePrice>>
-			 | <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">> <<set $personalShares += 15000>>
-			 <<set $publicShares -= 15000>>
-			 <<set $cash -= 15000*$sharePrice>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(101,102,$PC.trading >= 100 ? 101 : 102)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "You bought <<print commaNum(15000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@, driving the share price up somewhat.">>
-				<</replace>>
-		 <</link>>
+			| <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">> <<set $personalShares += 15000>>
+			<<set $publicShares -= 15000>>
+			<<set $cash -= 15000*$sharePrice>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(101,102,$PC.trading >= 100 ? 101 : 102)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "You bought <<print commaNum(15000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@, driving the share price up somewhat.">>
+			<</replace>>
+			<</link>>
 		<</if>>
 		<<if $publicShares > 20000 && $cash >= 20000*$sharePrice>>
-			 | <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">> <<set $personalShares += 20000>>
-			 <<set $publicShares -= 20000>>
-			 <<set $cash -= 20000*$sharePrice>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(101,102,$PC.trading >= 100 ? 101 : 102)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "You bought <<print commaNum(20000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@, driving the share price up significantly.">>
-				<</replace>>
-		 <</link>>
+			| <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">> <<set $personalShares += 20000>>
+			<<set $publicShares -= 20000>>
+			<<set $cash -= 20000*$sharePrice>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(101,102,$PC.trading >= 100 ? 101 : 102)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "You bought <<print commaNum(20000)>> shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@, driving the share price up significantly.">>
+			<</replace>>
+			<</link>>
 		<</if>>
 	<<elseif $publicShares > 1000>>
 		//You are unable to purchase <<print commaNum(1000)>> shares at the current share price, valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@.//
@@ -394,55 +390,53 @@ You hold <<print commaNum($personalShares)>> shares valued at @@.yellowgreen;<<p
 
 	<br>Direct the corporation to buy back publicly held shares:
 	<<if $corpCash > 1000*$sharePrice && $publicShares > 1000>>
-		<<if $publicShares > 1000 && $corpCash >= 1000*$sharePrice>>
-			 <<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">>
-			 <<set $publicShares -= 1000>>
-			 <<set $corpCash -= 1000*Math.ceil($sharePrice)>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(101,102)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "The corporation bought back <<print commaNum(1000)>> public shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@, driving the share price up slightly.">>
-				<</replace>>
-		 <</link>>
-		<</if>>
+		<<link "<<print commaNum(1000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@">>
+		<<set $publicShares -= 1000>>
+		<<set $corpCash -= 1000*Math.ceil($sharePrice)>>
+		<<set $sharePrice = (Math.trunc($sharePrice*either(101,102)))/100>>
+		<<replace "#CorpAction">>
+			<br> <<print "The corporation bought back <<print commaNum(1000)>> public shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@, driving the share price up slightly.">>
+		<</replace>>
+		<</link>>
 		<<if $publicShares > 5000 && $corpCash >= 5000*$sharePrice>>
-			 | <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">>
-			 <<set $publicShares -= 5000>>
-			 <<set $corpCash -= 5000*Math.ceil($sharePrice)>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(101,102)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "The corporation bought back <<print commaNum(5000)>> public shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@, driving the share price up slightly.">>
-				<</replace>>
-		 <</link>>
+			| <<link "<<print commaNum(5000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@">>
+			<<set $publicShares -= 5000>>
+			<<set $corpCash -= 5000*Math.ceil($sharePrice)>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(101,102)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "The corporation bought back <<print commaNum(5000)>> public shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*5000))>>@@, driving the share price up slightly.">>
+			<</replace>>
+			<</link>>
 		<</if>>
 		<<if $publicShares > 10000 && $corpCash >= 10000*$sharePrice>>
-			 | <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">>
-			 <<set $publicShares -= 10000>>
-			 <<set $corpCash -= 10000*Math.ceil($sharePrice)>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(101,102)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "The corporation bought back <<print commaNum(10000)>> public shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@, driving the share price up slightly.">>
-				<</replace>>
-		 <</link>>
+			| <<link "<<print commaNum(10000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@">>
+			<<set $publicShares -= 10000>>
+			<<set $corpCash -= 10000*Math.ceil($sharePrice)>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(101,102)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "The corporation bought back <<print commaNum(10000)>> public shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*10000))>>@@, driving the share price up slightly.">>
+			<</replace>>
+			<</link>>
 		<</if>>
 		<<if $publicShares > 15000 && $corpCash >= 15000*$sharePrice>>
-			 | <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">>
-			 <<set $publicShares -= 15000>>
-			 <<set $corpCash -= 15000*Math.ceil($sharePrice)>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(101,102)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "The corporation bought back <<print commaNum(15000)>> public shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@, driving the share price up somewhat.">>
-				<</replace>>
-		 <</link>>
+			| <<link "<<print commaNum(15000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@">>
+			<<set $publicShares -= 15000>>
+			<<set $corpCash -= 15000*Math.ceil($sharePrice)>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(101,102)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "The corporation bought back <<print commaNum(15000)>> public shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*15000))>>@@, driving the share price up somewhat.">>
+			<</replace>>
+			<</link>>
 		<</if>>
 		<<if $publicShares > 20000 && $corpCash >= 20000*$sharePrice>>
-			 | <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">>
-			 <<set $publicShares -= 20000>>
-			 <<set $corpCash -= 20000*Math.ceil($sharePrice)>>
-			 <<set $sharePrice = (Math.trunc($sharePrice*either(101,102)))/100>>
-			 <<replace "#CorpAction">>
-					<br> <<print "The corporation bought back <<print commaNum(20000)>> public shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@, driving the share price up significantly.">>
-				<</replace>>
-		 <</link>>
+			| <<link "<<print commaNum(20000)>> valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@">>
+			<<set $publicShares -= 20000>>
+			<<set $corpCash -= 20000*Math.ceil($sharePrice)>>
+			<<set $sharePrice = (Math.trunc($sharePrice*either(101,102)))/100>>
+			<<replace "#CorpAction">>
+				<br> <<print "The corporation bought back <<print commaNum(20000)>> public shares valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*20000))>>@@, driving the share price up significantly.">>
+			<</replace>>
+			<</link>>
 		<</if>>
 	<<elseif $publicShares > 1000>>
 		//The corporation is unable to purchase <<print commaNum(1000)>> shares at the current share price, valued at @@.yellowgreen;<<print cashFormat(Math.ceil($sharePrice*1000))>>@@.//
-- 
GitLab