diff --git a/src/SecExp/SecExpBackwardCompatibility.tw b/src/SecExp/SecExpBackwardCompatibility.tw
index 1708368a8f1e4b921a17a88cd37abbc0a77688aa..8efeeb27226b8b128c52b13658afdbcbdf6d3741 100644
--- a/src/SecExp/SecExpBackwardCompatibility.tw
+++ b/src/SecExp/SecExpBackwardCompatibility.tw
@@ -433,20 +433,20 @@
 	defense: 0,
 	hp:0}>>
 <<else>>
-	<<if isInt($droneUpgrades)>>
+	<<if Number.isInteger($droneUpgrades)>>
 		<<unset $droneUpgrades>>
 		<<set $droneUpgrades = {
 		attack: 0,
 		defense: 0,
 		hp:0}>>
 	<</if>>
-	<<if ndef $droneUpgrades.attack || !isInt($droneUpgrades.attack)>>
+	<<if ndef $droneUpgrades.attack || !Number.isInteger($droneUpgrades.attack)>>
 		<<set $droneUpgrades.attack = 0>>
 	<</if>>
-	<<if ndef $droneUpgrades.defense || !isInt($droneUpgrades.defense)>>
+	<<if ndef $droneUpgrades.defense || !Number.isInteger($droneUpgrades.defense)>>
 		<<set $droneUpgrades.defense = 0>>
 	<</if>>
-	<<if ndef $droneUpgrades.hp || !isInt($droneUpgrades.hp)>>
+	<<if ndef $droneUpgrades.hp || !Number.isInteger($droneUpgrades.hp)>>
 		<<set $droneUpgrades.hp = 0>>
 	<</if>>
 <</if>>
@@ -463,7 +463,7 @@
 	hp:0,
 	morale: 0}>>
 <<else>>
-	<<if isInt($humanUpgrade)>>
+	<<if Number.isInteger($humanUpgrade)>>
 		<<unset $humanUpgrade>>
 		<<set $humanUpgrade = {
 		attack: 0,
@@ -471,16 +471,16 @@
 		hp:0,
 		morale: 0}>>
 	<</if>>
-	<<if ndef $humanUpgrade.attack || !isInt($humanUpgrade.attack)>>
+	<<if ndef $humanUpgrade.attack || !Number.isInteger($humanUpgrade.attack)>>
 		<<set $humanUpgrade.attack = 0>>
 	<</if>>
-	<<if ndef $humanUpgrade.defense || !isInt($humanUpgrade.defense)>>
+	<<if ndef $humanUpgrade.defense || !Number.isInteger($humanUpgrade.defense)>>
 		<<set $humanUpgrade.defense = 0>>
 	<</if>>
-	<<if ndef $humanUpgrade.hp || !isInt($humanUpgrade.hp)>>
+	<<if ndef $humanUpgrade.hp || !Number.isInteger($humanUpgrade.hp)>>
 		<<set $humanUpgrade.hp = 0>>
 	<</if>>
-	<<if ndef $humanUpgrade.morale || !isInt($humanUpgrade.morale)>>
+	<<if ndef $humanUpgrade.morale || !Number.isInteger($humanUpgrade.morale)>>
 		<<set $humanUpgrade.morale = 0>>
 	<</if>>
 <</if>>
diff --git a/src/SecExp/attackReport.tw b/src/SecExp/attackReport.tw
index c258dbdf444c4e78cf60c5e9c2e6adab4e13a053..d36aff21bcfe8eadd0e72a1d0041fa84b6650af9 100644
--- a/src/SecExp/attackReport.tw
+++ b/src/SecExp/attackReport.tw
@@ -750,7 +750,7 @@
 	<</if>>
 	<<run cashX(forceNeg($bribeCost), "war")>>
 <</if>>
-<<if !isInt($lowerClass)>>
+<<if !Number.isInteger($lowerClass)>>
 	<<if isNaN($lowerClass)>>
 		<br>@@.red;Error: lowerClass is NaN, please report this issue@@
 	<<elseif $lowerClass > 0>>
@@ -759,7 +759,7 @@
 		<<set $lowerClass = 0>>
 	<</if>>
 <</if>>
-<<if !isInt($NPCSlaves)>>
+<<if !Number.isInteger($NPCSlaves)>>
 	<<if isNaN($NPCSlaves)>>
 		<br>@@.red;Error: NPCSlaves is NaN, please report this issue@@
 	<<elseif $NPCSlaves > 0>>
diff --git a/src/SecExp/rebellionGenerator.tw b/src/SecExp/rebellionGenerator.tw
index a8b7d30003150fa013f80419b69d157f20eb573e..7f629bc71fb98e6696fe9277dd793e994097d404 100644
--- a/src/SecExp/rebellionGenerator.tw
+++ b/src/SecExp/rebellionGenerator.tw
@@ -196,7 +196,7 @@
 	<<elseif $citizenRebellionEventFires == 1>>
 		@@.red;citizen malcontent increased@@.
 	<</if>>
-<<elseif !isInt($tension)>>
+<<elseif !Number.isInteger($tension)>>
 	<br>Error: tension is outside accepted range.
 <</if>>
 
diff --git a/src/SecExp/unitsBattleReport.tw b/src/SecExp/unitsBattleReport.tw
index fce1092cc1b686f22419014aaa28e9be13209071..503111bf7546bdde879d02bebee1d0f7c35d9730 100644
--- a/src/SecExp/unitsBattleReport.tw
+++ b/src/SecExp/unitsBattleReport.tw
@@ -81,7 +81,7 @@
 	/* sanity check for losses */
 	<<set _count = 0>>
 	<<for _i = 0; _i < _lossesList.length; _i++>>
-		<<if !isInt(_lossesList[_i])>>
+		<<if !Number.isInteger(_lossesList[_i])>>
 			<<set _lossesList[_i] = 0>>
 		<</if>>
 		<<set _count += _lossesList[_i]>>
diff --git a/src/SecExp/unitsRebellionReport.tw b/src/SecExp/unitsRebellionReport.tw
index 235bbacc991fbb26961f821054ffb46cb036de58..7b6a1c20c85fc22263be5be3efe7074d0dd5106c 100644
--- a/src/SecExp/unitsRebellionReport.tw
+++ b/src/SecExp/unitsRebellionReport.tw
@@ -279,7 +279,7 @@
 	/* sanity check for losses */
 	<<set _count = 0>>
 	<<for _i = 0; _i < _lossesList.length; _i++>>
-		<<if !isInt(_lossesList[_i])>>
+		<<if !Number.isInteger(_lossesList[_i])>>
 			<<set _lossesList[_i] = 0>>
 		<</if>>
 		<<set _count += _lossesList[_i]>>
diff --git a/src/SecExp/widgets/battleWidgets.tw b/src/SecExp/widgets/battleWidgets.tw
index fbf36b41b7c4a108e98bdceab28245703f3049f7..183ca80de9af834dd8e2574bac6db1a6be6978cb 100644
--- a/src/SecExp/widgets/battleWidgets.tw
+++ b/src/SecExp/widgets/battleWidgets.tw
@@ -4,14 +4,14 @@
 	<<if $slaveRebellion != 1 || $citizenRebellion != 1>>
 		/* atk, def */
 		<<set _upgradesSum = $SF.Squad.Armoury + $SF.Squad.Drugs + ($SF.Squad.AA+$SF.Squad.TA < 1) + ($SF.Squad.AV+$SF.Squad.TV)>>
-		<<if !isInt(_upgradesSum)>>
+		<<if !Number.isInteger(_upgradesSum)>>
 			<<set _upgradesSum = random(10,15)>>
 		<</if>>
 		<<set $SFatk = Math.trunc(0.65 * _upgradesSum)>>
 		<<set $SFdef = Math.trunc(0.40 * _upgradesSum)>>
 		/* hp */
 		<<set $carriableSoldiers = 125 * ($SF.Squad.GunS + (($SF.Squad.AV + $SF.Squad.TV)/2))>>
-		<<if !isInt($carriableSoldiers)>>
+		<<if !Number.isInteger($carriableSoldiers)>>
 			<<set $carriableSoldiers = $SF.Squad.Troops / 10>>
 		<</if>>
 		<<if $SF.Squad.Troops > $carriableSoldiers>>
@@ -23,7 +23,7 @@
 	<<else>>
 		/* atk, def */
 		<<set _upgradesSum = $SF.Squad.Armoury + $SF.Squad.Drugs + ($SF.Squad.AA+$SF.Squad.TA < 1) + ($SF.Squad.AV+$SF.Squad.TV)>>
-		<<if !isInt(_upgradesSum)>>
+		<<if !Number.isInteger(_upgradesSum)>>
 			<<set _upgradesSum = random(10,15)>>
 		<</if>>
 		<<set $SFatk = Math.trunc(0.75 * _upgradesSum)>>
diff --git a/src/SecExp/widgets/miscSecExpWidgets.tw b/src/SecExp/widgets/miscSecExpWidgets.tw
index e704c8f183aeca1e8f57d2b7b25fec165cf00fea..5fd970e2375ccf76b80e681f5a6e1b409c48aca3 100644
--- a/src/SecExp/widgets/miscSecExpWidgets.tw
+++ b/src/SecExp/widgets/miscSecExpWidgets.tw
@@ -233,7 +233,7 @@
 		<br>Fixed security bots wrong max troop count.
 		<<set $secBots.maxTroops = 30>>
 	<</if>>
-	<<if !isInt($secBots.troops)>>
+	<<if !Number.isInteger($secBots.troops)>>
 		<br>Fixed security bots wrong max troop count.
 		<<set $secBots.troops = $secBots.maxTroops>>
 	<</if>>
@@ -263,7 +263,7 @@
 			<br>Fixed militia unit wrong max troop count.
 			<<set $militiaUnits[_i].maxTroops = 30>>
 		<</if>>
-		<<if !isInt($militiaUnits[_i].troops)>>
+		<<if !Number.isInteger($militiaUnits[_i].troops)>>
 			<<set $militiaUnits[_i].troops = $militiaUnits[_i].maxTroops>>
 			<br>Fixed militia unit wrong troop count.
 		<</if>>
@@ -294,7 +294,7 @@
 			<br>Fixed slave unit wrong max troop count.
 			<<set $slaveUnits[_i].maxTroops = 30>>
 		<</if>>
-		<<if !isInt($slaveUnits[_i].troops)>>
+		<<if !Number.isInteger($slaveUnits[_i].troops)>>
 			<<set $slaveUnits[_i].troops = $slaveUnits[_i].maxTroops>>
 			<br>Fixed slave unit wrong troop count.
 		<</if>>
@@ -325,7 +325,7 @@
 			<br>Fixed merc unit wrong max troop count.
 			<<set $mercUnits[_i].maxTroops = 30>>
 		<</if>>
-		<<if !isInt($mercUnits[_i].troops)>>
+		<<if !Number.isInteger($mercUnits[_i].troops)>>
 			<<set $mercUnits[_i].troops = $mercUnits[_i].maxTroops>>
 			<br>Fixed merc unit wrong troop count.
 		<</if>>
@@ -337,37 +337,37 @@
 <</widget>>
 
 <<widget "fixBrokenStats">>
-	<<if !isInt($totalKills)>>
+	<<if !Number.isInteger($totalKills)>>
 		<<set $totalKills = 0>>
 	<</if>>
-	<<if !isInt($mercTotalCasualties)>>
+	<<if !Number.isInteger($mercTotalCasualties)>>
 		<<set $mercTotalCasualties = 0>>
 	<</if>>
-	<<if !isInt($mercEmployedManpower)>>
+	<<if !Number.isInteger($mercEmployedManpower)>>
 		<<set $mercEmployedManpower = 0>>
 	<</if>>
-	<<if !isInt($mercTotalManpower)>>
+	<<if !Number.isInteger($mercTotalManpower)>>
 		<<set $mercTotalManpower = 0>>
 	<</if>>
-	<<if !isInt($slavesTotalCasualties)>>
+	<<if !Number.isInteger($slavesTotalCasualties)>>
 		<<set $slavesTotalCasualties = 0>>
 	<</if>>
-	<<if !isInt($slavesEmployedManpower)>>
+	<<if !Number.isInteger($slavesEmployedManpower)>>
 		<<set $slavesEmployedManpower = 0>>
 	<</if>>
-	<<if !isInt($militiaTotalCasualties)>>
+	<<if !Number.isInteger($militiaTotalCasualties)>>
 		<<set $militiaTotalCasualties = 0>>
 	<</if>>
-	<<if !isInt($militiaEmployedManpower)>>
+	<<if !Number.isInteger($militiaEmployedManpower)>>
 		<<set $militiaEmployedManpower = 0>>
 	<</if>>
-	<<if !isInt($militiaFreeManpower)>>
+	<<if !Number.isInteger($militiaFreeManpower)>>
 		<<set $militiaFreeManpower = 0>>
 	<</if>>
-	<<if !isInt($militiaTotalManpower)>>
+	<<if !Number.isInteger($militiaTotalManpower)>>
 		<<set $militiaTotalManpower = 0>>
 	<</if>>
-	<<if !isInt($battlesCount)>>
+	<<if !Number.isInteger($battlesCount)>>
 		<<set $battlesCount = 0>>
 	<</if>>
 <</widget>>
diff --git a/src/js/utilJS.js b/src/js/utilJS.js
index e3cb2928bb36e496705724e1c64fa623e26a52ee..7506847e8c526c42d9be1ac552d140a61701d84c 100644
--- a/src/js/utilJS.js
+++ b/src/js/utilJS.js
@@ -413,29 +413,6 @@ window.gaussianPair = function() {
 	return [r * Math.cos(sigma), r * Math.sin(sigma)];
 };
 
-if (!Array.prototype.findIndex) {
-	Array.prototype.findIndex = function(predicate) {
-		if (this == null) {
-			throw new TypeError('Array.prototype.find called on null or undefined');
-		}
-		if (typeof predicate !== 'function') {
-			throw new TypeError('predicate must be a function');
-		}
-		let list = Object(this);
-		let length = list.length >>> 0;
-		let thisArg = arguments[1];
-		let value;
-
-		for (let i = 0; i < length; i++) {
-			value = list[i];
-			if (predicate.call(thisArg, value, i, list)) {
-				return i;
-			}
-		}
-		return -1;
-	};
-}
-
 /*
 A categorizer is used to "slice" a value range into distinct categories in an efficient manner.
 
@@ -736,11 +713,7 @@ window.budgetLine = function(category, title) {
 };
 
 window.isFloat = function(n) {
-	return n === +n && n !== (n|0);
-};
-
-window.isInt = function(n) {
-	return n === +n && n === (n|0);
+	return Number.isFinite(n) && Math.floor(n) !== n;
 };
 
 window.jsRandom = function(min, max) {
diff --git a/src/uncategorized/arcmgmt.tw b/src/uncategorized/arcmgmt.tw
index 0013f17583c9afb0a24c8e4909eec38fbec43c28..f6bce3e54467d37bb95fb52f288d5b488229062f 100644
--- a/src/uncategorized/arcmgmt.tw
+++ b/src/uncategorized/arcmgmt.tw
@@ -1079,7 +1079,7 @@ _percTopClass = Math.trunc(($topClass / ($ACitizens + $ASlaves)) * 1000) / 10>>
 	Those of your citizens who have not yet subscribed to the society you are building are permitted to live and do business here, but must pay a moderate jizya tax for the privilege as part of their rent.
 <</if>>
 <<set _rents = Math.trunc(($lowerClass * $LCRent + $middleClass * $MCRent + $upperClass * $UCRent + $topClass * $TCRent) * _rentMultiplier / 25)>>
-<<if !isInt(_rents)>>
+<<if !Number.isInteger(_rents)>>
 	<br>@@.red;Error: rents is outside accepted range, please report this issue@@
 <<else>>
 	<<run cashX(_rents, "rents")>>
diff --git a/src/uncategorized/persBusiness.tw b/src/uncategorized/persBusiness.tw
index 31e7c744dc0237060921bc09be4617a33c92c62b..1b5f7747402b2a2c1a550f4060bd0f0ae2f0d1e1 100644
--- a/src/uncategorized/persBusiness.tw
+++ b/src/uncategorized/persBusiness.tw
@@ -737,7 +737,7 @@
 			<<set _upgradeCount += 1>>
 		<</if>>
 		<<set _dataGain = _upgradeCount * 200>>
-		<<if !isInt(_dataGain)>>
+		<<if !Number.isInteger(_dataGain)>>
 			<br>@@.red;Error, dataGain is NaN@@
 		<<else>>
 			You are selling the data collected by your security department, which earns a discreet sum of @@.yellowgreen;<<print cashFormat(_dataGain)>>@@.
@@ -855,7 +855,7 @@ Routine upkeep of your demesne costs @@.yellow;<<print cashFormat($costs)>>.@@
 		<</if>>
 		<<set _income = Math.trunc(_income * 0.5)>>
 		This week we made @@.yellowgreen;<<print cashFormat(_income)>>.@@
-		<<if !isInt(_income)>>
+		<<if !Number.isInteger(_income)>>
 			<br>@@.red;Error failed to calculate income@@
 		<<else>>
 			<<run cashX(_income, "personalBusiness")>>