text: var upgdesc1 = "Increase production of Workers per producer bought." //Coin Upgrades 1-20
  var upgdesc2 = "Increase production of Investments per producer bought."
  var upgdesc3 = "Increase production of Printers per producer bought."
  var upgdesc4 = "Increase production of Mints per producer bought."
  var upgdesc5 = "Increase production of Alchemies per producer bought."
  var upgdesc6 = "Increase all production by 25% per producer bought."
  var upgdesc7 = "Gain free multipliers based on your purchased Alchemies."
  var upgdesc8 = "Gain 1 free Accelerator per 7 purchased Multipliers."
  var upgdesc9 = "Gain 1 free Multiplier per 10 purchased Accelerators."
  var upgdesc10 = "Improve Workers based on the first 750 purchased Investments."
  var upgdesc11 = "Accelerators improve generation production by 2% each."
  var upgdesc12 = "Each prestige multiplies production by 1.01, multiplicatively (Max: 1e4x)."
  var upgdesc13 = "Augments buff the production of Investments."
  var upgdesc14 = "Free Accelerators buff generation of Printers."
  var upgdesc15 = "Free Accelerators buff generation of Mints."
  var upgdesc16 = "Acceleration Multiplier buffs Diamond gain."
  var upgdesc17 = "Multiply Mint production by 1e+100."
  var upgdesc18 = "Multiply Printer production based on Mythos Shards."
  var upgdesc19 = "Multiply Investment production based on Mythos."
  var upgdesc20 = "Coin upgrade 1 is raised to the eleventh power."
  var upgdesc21 = "Gain 1 Multiplier and 5 Accelerators plus 1% more free Multipliers/Accelerators." //Prestige Upgrades 21-40
  var upgdesc22 = "Gain 1 Multiplier and 4 Accelerators plus 1% more free Multipliers/Accelerators."
  var upgdesc23 = "Gain 1 Multiplier and 3 Accelerators plus 1% more free Multipliers/Accelerators."
  var upgdesc24 = "Gain 1 Multiplier and 2 Accelerators plus 1% more free Multipliers/Accelerators."
  var upgdesc25 = "Gain 1 Multiplier and 1 Accelerators plus 1% more free Multipliers/Accelerators."
  var upgdesc26 = "Gain a free Accelerator Boost."
  var upgdesc27 = "Gain free Accelerators based on unspent Coins."
  var upgdesc28 = "Gain a free Multiplier per 160 Coin producers bought."
  var upgdesc29 = "Gain a free Accelerator per 80 Coin producers bought."
  var upgdesc30 = "Gain free Multipliers based on unspent Coins."
  var upgdesc31 = "Gain 1 free Accelerator Boost per 2,000 Coin producers bought."
  var upgdesc32 = "Gain free Accelerators based on Unspent Diamonds."
  var upgdesc33 = "Gain 1 free Multiplier for each Accelerator Boost owned."
  var upgdesc34 = "Gain 3% more free Multipliers."
  var upgdesc35 = "Gain 2% more free Multipliers."
  var upgdesc36 = "Multiply crystal production by Diamonds, maximum 1e5000x."
  var upgdesc37 = "Multiply mythos shard production by the squared logarithm of Diamonds."
  var upgdesc38 = "Gain +20% more offerings thanks to generous Discord Server Boosters!"
  var upgdesc39 = "Gain +60% more Ant Speed thanks to generous Discord Server Boosters!"
  var upgdesc40 = "Gain +9% more Ant Sacrifice rewards thanks to generous Discord Server Boosters!"
  var upgdesc41 = "Multiply production based on unspent Mythos."
  var upgdesc42 = "Multiply Mythos Shard production based on unspent Diamonds."
  var upgdesc43 = "Multiply coin production by 1.01 per transcension (Max: 1e30x)."
  var upgdesc44 = "Multiply Mythos gain on Transcend by 1.01 per transcension (Max: 1e6x)."
  var upgdesc45 = "Gain free Accelerators based on Mythos Shards."
  var upgdesc46 = "Accelerator Boosts are 5% stronger and do not reset prestige features."
  var upgdesc47 = "Multiply Mythos Shard production based on your AP."
  var upgdesc48 = "Multiply production based on owned Accelerators and Multipliers."
  var upgdesc49 = "Gain free Multipliers based on unspent Mythos."
  var upgdesc50 = "Gain +25% free Accelerators and Multipliers, but ONLY while doing challenges."
  var upgdesc51 = "Increase production of all Mythos buildings based on owned Accelerator Boosts."
  var upgdesc52 = "Mythos building exponent +0.025."
  var upgdesc53 = "Augments produce more Shards based on Acceleration Multiplier."
  var upgdesc54 = "Wizards produce more Enchantments based on Multiplier."
  var upgdesc55 = "Grandmasters produce more Oracles based on Building power."
  var upgdesc56 = "Worker production is multiplied by 1e+5000."
  var upgdesc57 = "Investment production is multiplied by 1e+7500."
  var upgdesc58 = "Printer production is multiplied by 1e+15000."
  var upgdesc59 = "Coin Mint production is multiplied by 1e+25000."
  var upgdesc60 = "Alchemies production is multiplied by 1e+35000." //Reincarnation Upgrades 61-100
  var upgdesc61 = "Welcome to reincarnation! +5% Offering Recycle, +5 EXP/Offering!"
  var upgdesc62 = "Completing challenges, automatically or manually, increase offerings gained in Reincarnation. Bonus subject to time multiplier!"
  var upgdesc63 = "Crystal Production is multiplied based on Particles to the sixth power [Caps at 1e6000x]."
  var upgdesc64 = "Mythos Shard Production is multiplied by your Particles squared."
  var upgdesc65 = "Multiply the gain of Particles from Reincarnation by 5x!"
  var upgdesc66 = "When you use an Offering, every unlocked rune will get 3 free experience."
  var upgdesc67 = "Atom gain is increased by 3% per Particle producer purchased!"
  var upgdesc68 = "Gain a free multiplier for every 1e1000x increase in tax."
  var upgdesc69 = "Gain more Obtainium based on your particle gain. [Works with automation at a reduced rate!]"
  var upgdesc70 = "Gain more Obtainium from Reincarnations based on how long your current reincarnation is."
  var upgdesc71 = "Runes will gain (Rune Level) additional EXP per offering used."
  var upgdesc72 = "Obtainium gain from Reincarnations is multiplied (1 + 2C) where C is #Reincarnation Challenges completed, up to 50x!"
  var upgdesc73 = "Gain +100% free accelerator boosts and +10 free Crystal Upgrade levels, but only in Reincarnation Challenges."
  var upgdesc74 = "Obtainium gain is increased based on highest ever unspent offerings. [Max: 100,000 unspent]"
  var upgdesc75 = "Offering gain is increased based on highest ever unspent obtainium [Max: 30,000,000 obtainium]"
  var upgdesc76 = "Ant generation kinda slow? I agree! Make all ant tiers 5x faster!"
  var upgdesc77 = "This is Synergism, right? Let's make each purchased ant make all ants 0.5% faster."
  var upgdesc78 = "Hate spam clicking? Autosacrifice AND Manual spending spends 1,000x more offerings at a time."
  var upgdesc79 = "The Ant God will accept an arbitrary number of Particles in order to give you 10% more from sacrifices."
  var upgdesc80 = "The Ant God will accept a larger arbitrary number of Particles to give you more ant ELO."
  var upgdesc81 = "Automatically buy Workers if affordable." //Automation Upgrades 81-100
  var upgdesc82 = "Automatically buy Investments if affordable."
  var upgdesc83 = "Automatically buy Printers if affordable."
  var upgdesc84 = "Automatically buy Coin Mints if affordable."
  var upgdesc85 = "Automatically buy Alchemies if affordable."
  var upgdesc86 = "Automatically buy Accelerators if affordable."
  var upgdesc87 = "Automatically buy Multipliers if affordable."
  var upgdesc88 = "Automatically buy Accelerator Boosts if affordable."
  var upgdesc89 = "Unlock Automatic Transcensions."
  var upgdesc90 = "Automatically buy from the Generator Shop."
  var upgdesc91 = "Automatically buy Coin Upgrades."
  var upgdesc92 = "Automatically buy Diamond Upgrades."
  var upgdesc93 = "Generate 1% of Diamond Gain from prestiging per second."
  var upgdesc94 = "Automatically buy Augments if affordable."
  var upgdesc95 = "Automatically buy Enchantments if affordable."
  var upgdesc96 = "Automatically buy Wizards if affordable."
  var upgdesc97 = "Automatically buy Oracles if affordable."
  var upgdesc98 = "Automatically buy Grandmasters if affordable."
  var upgdesc99 = "Automatically buy Mythos Upgrades if affordable."
  var upgdesc100 = "Generate 1% of Mythos Gain from transcending per second."
  var upgdesc101 = "Alchemies will produce Coin Mints." // Generator Upgrades 101-120
  var upgdesc102 = "Coin Mints will produce Printers."
  var upgdesc103 = "Printers will produce Investments."
  var upgdesc104 = "Investments will produce Workers."
  var upgdesc105 = "Purchased Workers will produce Alchemies."
  var upgdesc106 = "Refineries can produce Alchemies equal to Refineries owned raised to 0.10"
  var upgdesc107 = "Refinery -> Alchemy exponent increased from 0.10 to 0.25."
  var upgdesc108 = "Refinery -> Alchemy exponent increased from 0.25 to 0.50"
  var upgdesc109 = "Refinery -> Alchemy exponent increased from 0.50 to 0.75"
  var upgdesc110 = "Refinery -> Alchemy exponent increased from 0.75 to 1"
  var upgdesc111 = "Augments can produce Pandora Boxes equal to Augments owned raised to 0.08"
  var upgdesc112 = "Augment -> Box exponent increased from 0.08 to 0.16"
  var upgdesc113 = "Augment -> Box exponent increased from 0.16 to 0.24"
  var upgdesc114 = "Augment -> Box exponent increased from 0.24 to 0.32"
  var upgdesc115 = "Augment -> Box exponent increased from 0.32 to 0.40"
  var upgdesc116 = "Protons can produce Grandmasters equal to Protons owned raised to 0.05"
  var upgdesc117 = "Protons -> Grandmaster exponent increased from 0.05 to 0.10"
  var upgdesc118 = "Protons -> Grandmaster exponent increased from 0.10 to 0.15"
  var upgdesc119 = "Protons -> Grandmaster exponent increased from 0.15 to 0.20"
  var upgdesc120 = "Protons -> Grandmaster exponent increased from 0.20 to 0.25"
  var crystalupgdesc1 = "Gain a 5% multiplicative boost to crystals per AP per level."
  var crystalupgdesc2 = "Gain a boost to crystals based on held coins per level."
  var crystalupgdesc3 = "Each purchased Crystal producer increases generation of Crystal producers by .1% per level. [MAX: 12%]"
  var crystalupgdesc4 = "Improve the multiplier to coin production by .05 exponent per level. [MAX: +10.00]"
  var crystalupgdesc5 = "Every challenge completion increases crystal gain by 1% per level."
  var crystalupgdesc6 = "Coming SOON!"
  var crystalupgdesc7 = "Coming SOON!"
  var crystalupgdesc8 = "Coming SOON!"
  
  
  const upgradetexts = [null,
      function() { return "Worker Production x" + format((totalCoinOwned + 1) * Math.min(1e30, Math.pow(1.008, totalCoinOwned)),2) },
  function() { return "Investment Production x" + format((totalCoinOwned + 1) * Math.min(1e30, Math.pow(1.008, totalCoinOwned)),2) },
  function() { return "Printer Production x" + format((totalCoinOwned + 1) * Math.min(1e30, Math.pow(1.008, totalCoinOwned)),2) },
  function() { return "Mint Production x" + format((totalCoinOwned + 1) * Math.min(1e30, Math.pow(1.008, totalCoinOwned)),2) },
  function() { return "Alchemy Production x" + format((totalCoinOwned + 1) * Math.min(1e30, Math.pow(1.008, totalCoinOwned)),2) },
  function() { return "All Coin production x" + format((totalCoinOwned + 1) * Math.min(1e30, Math.pow(1.008, totalCoinOwned)),2) },
  function() { return "Gain " + Math.min(4, 1 + Math.floor(Decimal.log(player.fifthOwnedCoin + 1, 10))) + " free multipliers from bought Alchemies."},
  function() { return "+" +Math.floor(player.multiplierBought/7) + " free Accelerators."},
  function() { return "+" + Math.floor(player.acceleratorBought/10) + " free Multipliers."},
  function() { return "Worker Production x" + format(Decimal.pow(2, Math.min(50, player.secondOwnedCoin/15)),2)},
  function() { return "Generator efficiency x" + format(Decimal.pow(1.02, freeAccelerator),2)},
  function() { return "All Coin production x" + format(Decimal.min(1e4, Decimal.pow(1.01, player.prestigeCount)), 2)},
  function() { return "Investment Production x" + format(Decimal.min(1e50, Decimal.pow(player.firstGeneratedMythos.add(player.firstOwnedMythos).add(1), 4/3).times(1e10)),2)},
  function() { return "Printer Generation x" +format(Decimal.pow(1.15, freeAccelerator),2)},
  function() { return "Mint Generation x" +format(Decimal.pow(1.15, freeAccelerator),2)},
  function() { return "Gain " + format(Decimal.pow(acceleratorEffect, 1/3),2) + "x more Diamonds on prestige"},
  function() { return "Mint Production x1e100 (Duh)"},
  function() { return "Printer Prodction x" + format(Decimal.min(1e125, player.transcendShards.add(1)))},
  function() { return "Investment Production x" + format(Decimal.min(1e200, player.transcendPoints.times(1e30).add(1)))},
  function() { return "All coin production is further multiplied by " + format(Decimal.pow((totalCoinOwned + 1) * Math.min(1e30, Math.pow(1.008, totalCoinOwned)),10),2) + " [Stacks with upgrade 1]!"},
  function() { return "+" + format(Math.floor((1 + (1/101 * freeMultiplier)))) + " Multipliers, +" + format(Math.floor((5 + (1/101 * freeAccelerator)))) + " Accelerators."},
  function() { return "+" + format(Math.floor((1 + (1/101 * freeMultiplier)))) + " Multipliers, +" + format(Math.floor((4 + (1/101 * freeAccelerator)))) + " Accelerators."},
  function() { return "+" + format(Math.floor((1 + (1/101 * freeMultiplier)))) + " Multipliers, +" + format(Math.floor((3 + (1/101 * freeAccelerator)))) + " Accelerators."},
  function() { return "+" + format(Math.floor((1 + (1/101 * freeMultiplier)))) + " Multipliers, +" + format(Math.floor((2 + (1/101 * freeAccelerator)))) + " Accelerators."},
  function() { return "+" + format(Math.floor((1 + (1/101 * freeMultiplier)))) + " Multipliers, +" + format(Math.floor((1 + (1/101 * freeAccelerator)))) + " Accelerators."},
  function() { return "+" + format(Math.floor((1 + (1/41 * freeAcceleratorBoost)))) + " Accelerator Boosts."},
  function() { return "+" + format(Math.min(250, Math.floor(Decimal.log(player.coins.add(1), 1e3))) +  Math.min(1750, Math.floor(Decimal.log(player.coins.add(1),1e15)) - 50)) + " Accelerators."},
  function() { return "+" + format(Math.min(1000, Math.floor((player.firstOwnedCoin + player.secondOwnedCoin + player.thirdOwnedCoin + player.fourthOwnedCoin + player.fifthOwnedCoin)/160))) + " Multipliers."},
  function() { return "+" + format(Math.floor(Math.min(2000,(player.firstOwnedCoin + player.secondOwnedCoin + player.thirdOwnedCoin + player.fourthOwnedCoin + player.fifthOwnedCoin) / 80))) + " Accelerators."},
  function() { return "+" + format(Math.min(75, Math.floor(Decimal.log(player.coins.add(1), 1e10))) + Math.min(925, Math.floor(Decimal.log(player.coins.add(1), 1e30)))) + " Multipliers."},
  function() { return "+" + format(Math.floor(totalCoinOwned/2000)) + " Accelerator Boosts"},
  function() { return "+" + format(Math.min(500, Math.floor(Decimal.log(player.prestigePoints.add(1), 1e25)))) + " Accelerators"},
  function() { return "+" + format(totalAcceleratorBoost) + " Multipliers"},
  function() { return "+" + format(Math.floor(3/103 * freeMultiplier)) + " Multipliers"},
  function() { return "+" + format(Math.floor(2/102 * freeMultiplier)) + " Multipliers"},
  function() { return "All Crystal producers x" + format(Decimal.min("1e5000", Decimal.pow(player.prestigePoints, 1/500)),2)},
  function() { return "All Mythos producers production x" + format(Decimal.pow(Decimal.log(player.prestigePoints.add(10),10),2),2)},
  function() { return "Gain +1% per Booster that the server has, up until 20!"},
  function() { return "Gain +2% per Booster that the server has, up until 30!"},
  function() { return "Every boost after 30 increases this reward by +1%, up until 50!"},
  function() { return "Welcome to Transcension! Coin production is multiplied by " + format(Decimal.min(1e30,Decimal.pow(player.transcendPoints.add(1), 1/2))) + "."},
  function() { return "All mythos shard producers are going into overdrive: x" + format(Decimal.min(1e50, Decimal.pow(player.prestigePoints.add(1), 1/50).dividedBy(2.5).add(1)),2) + " the production!"},
  function() { return "Multiply all coin production by " + format(Decimal.min(1e30, Decimal.pow(1.01, player.transcendCount)),2) + "!"},
  function() { return "Multiply Mythos gained in Transcension by " + format(Decimal.min(1e6, Decimal.pow(1.01, player.transcendCount)),2) + "!"},
  function() { return "+" + format(Math.min(2500, Math.floor(Decimal.log(player.transcendShards.add(1), 10)))) + " Accelerators!"},
  function() { return "It's kinda self-evident, ain't it?"},
  function() { return "Mythos-tier producers production x" + format(Math.pow(1.05, player.achievementPoints) * (player.achievementPoints + 1),2)},
  function() { return "Multiply coin production by a factor of " + format(Math.pow((totalMultiplier * totalAccelerator / 1000 + 1), 8)) + "!"},
  function() { return "+" + format(Math.min(50, Math.floor(Decimal.log(player.transcendPoints.add(1), 1e10)))) + " Multipliers through magic!"},
  function() { return "It's quite obvious what the benefit is, but you must be in a challenge for it to be in use!"},
  function() { return "Mythos-tier producers production x" + format(Math.pow(totalAcceleratorBoost, 2),2) + "!"},
  function() { return "Mythos-tier producers production x" + format(Decimal.pow(globalMythosMultiplier, 0.025),2) +"! It's like inception, or something."},
  function() { return "Augments will produce " + format(Decimal.min("1e1250", Decimal.pow(acceleratorEffect, 1/125)),2) + "x as many Mythos Shards."},
  function() { return "Wizards will produce " + format(Decimal.min("1e2000", Decimal.pow(multiplierEffect, 1/180)),2) + "x as many Enchantments; what productive spirits!"},
  function() { return "Grandmasters will produce " + format((Decimal.pow("1e1000", buildingPower - 1)),2) + "x as many Oracles!"},
  function() { return "It's quite obvious, ain't it?"},
  function() { return "Look above!"},
  function() { return "Look above!"},
  function() { return "Look above!"},
  function() { return "Look above!"},
  function() { return "+5% Offering Recycle/+5EXP per Offerings. Duh!"},
  function() { return "Base offering amount for Reincarnations +" + Math.floor(1/5 * (player.challengecompletions.one + player.challengecompletions.two + player.challengecompletions.three + player.challengecompletions.four + player.challengecompletions.five + player.challengecompletions.six + player.challengecompletions.seven + player.challengecompletions.eight)) + ". Challenge yourself!"},
  function() { return "All crystal production x" + format(Decimal.min("1e6000", Decimal.pow(player.reincarnationPoints.add(1),6)))},
  function() { return "All mythos shard production x" + format(Decimal.pow(player.reincarnationPoints.add(1),2))},
  function() { return "5x Particle gain from Reincarnations. Duh!"},
  function() { return "It's quite clear in the description!"},
  function() { return "The first particle-tier producer is " + format(Decimal.pow(1.03, player.firstOwnedParticles + player.secondOwnedParticles + player.thirdOwnedParticles + player.fourthOwnedParticles + player.fifthOwnedParticles),2) + "x as productive."},
  function() { return "Your compliance with tax laws provides you with " + format(Math.min(2500, Math.floor(1/1000 * Decimal.log(taxdivisor,10)))) + " free Multipliers, for some reason."},
  function() { return "Cosmic Magnetics will allow you to gain " + format(Math.min(10, Decimal.pow(Decimal.log(reincarnationPointGain.add(10), 10), 0.5)),2) + "x as much Obtainium reincarnating, x" + format(Math.min(3,Decimal.pow(Decimal.log(reincarnationPointGain.add(10), 10), 0.5)),2) + " automation gain."},
  function() { return "Your patience will allow you to gain " + format(Math.min(4, Math.max(1, Math.pow(player.reincarnationcounter/30,2))) * Math.pow(Math.min(19 + player.shopUpgrades.obtainiumTimerLevel * 0.6, 1 + player.reincarnationcounter / 200),2),2) + "x more Obtainium on Reincarnation."},
  function() { return "Writing's on the wall. Look above!"},
  function() { return "Obtainium multiplier: x" + Math.min(50, (1 + 2 * player.challengecompletions.six + 2 * player.challengecompletions.seven + 2 * player.challengecompletions.eight + 2 * player.challengecompletions.nine + 2 * player.challengecompletions.ten))},
  function() { return "Same as Transcend upgrade 10, except you MUST be in a Reincarnation challenge in particular."},
  function() { return "Obtainium multiplier: x" + format((1 + 4 * Math.min(1, Math.pow(player.maxofferings / 100000, 0.5))),2)},
  function() { return "Offering Multiplier: x" + format((1 + 2 * Math.min(1, Math.pow(player.maxobtainium/30000000, 0.5))),2)},
  function() { return "Epic 5x Ants!"},
  function() { return "Ant Speed Multiplier: x" + format((Decimal.pow(1.005 + 5/100000 * player.researches[96], player.firstOwnedAnts + player.secondOwnedAnts + player.thirdOwnedAnts + player.fourthOwnedAnts + player.fifthOwnedAnts + player.sixthOwnedAnts + player.seventhOwnedAnts + player.eighthOwnedAnts)),3)},
  function() { return "Look above please lol"},
  function() { return "You will gain +10% rewards =)"},
  function() { return "Ant Elo +75 if this upgrade is purchased."},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"},
  function() { return "All you need to know is right above this message!"}
  ]
      function upgradeeffects(i) {
          document.getElementById("upgradeeffect").innerHTML = "Effect: " + upgradetexts[i]()
       }
  
  
  
  function upgradedescriptions(i) {
      var x = "upgdesc" + i
      var y = window[x]
      var z = ""
      if (player.upgrades[i] > 0.5) {
          z = z + " BOUGHT!"
      }
      document.getElementById("upgradedescription").textContent = y + z
      if (player.upgrades[i] > 0.5) {
          document.getElementById("upgradedescription").style.color = "gold"
      }
      else {document.getElementById("upgradedescription").style.color = "white"}
  
      if (player.toggles.nine == true) { 
          var type = ''   
          if (i <= 20 && i >= 1) {type = 'coin'}
          if (i <= 40 && i >= 21) {type = 'prestige'}  
          if (i <= 60 && i >= 41) {type = 'transcend'}  
          if (i <= 80 && i >= 61) {type = 'reincarnation'}  
          if (i <= 87 && i >= 81) {type = 'prestige'}
          if (i <= 93 && i >= 88) {type = 'transcend'}
          if (i <= 100 && i >= 94) {type = 'reincarnation'}
          if (type !== '' && i <= 80 && i >= 1) {
          buyUpgrades(type,i)
          }
          if (type !== '' && i <= 100 && i >= 81) {
              var q=i-80;
          buyAutobuyers(q)
          }
          if (i <= 120 && i >= 101) {
              var q = i - 100
          buyGenerator(q)
          }
      }
  
      var currency = ''
      var color = ''
      if ((i <= 20 && i >= 1) || (i <= 110 && i >= 106)) {currency = "Coins"; color = "yellow"}
      if ((i <= 40 && i >= 21) || (i <= 105 && i >= 101) || (i <= 115 && i >= 111) || (i <= 87 && i >= 81)) {currency = "Diamonds"; color = "cyan"}
      if ((i <= 60 && i >= 41) || (i <= 120 && i >= 116) || (i <= 93 &&  i >= 88)) {currency = "Mythos"; color = "plum"}
      if ((i <= 80 && i >= 61) || (i <= 100 && i >= 94)) {currency = "Particles"; color = "limegreen"}
  
      document.getElementById("upgradecost").textContent = "Cost: " + format(Decimal.pow(10, upgradeCosts[i])) + " " + currency
      document.getElementById("upgradecost").style.color = color
      upgradeeffects(i)
  }
  
  function crystalupgradedescriptions(i) {
  
      var v = "crystalupgdesc" + i
      var w = window[v]
  
      var u = i - 1
      var p = player.crystalUpgrades[u]
      var c = 0;
      if (player.upgrades[73] > 0.5 && player.currentChallengeRein !== "") {c = 10}
      c += Math.floor(rune3level * (1 + player.researches[5] / 10) * (1 + player.researches[21]/800) / 10) * 100/100
      var q = Decimal.pow(10, (crystalUpgradesCost[u] + crystalUpgradeCostIncrement[u] * Math.floor(Math.pow(player.crystalUpgrades[u] + 0.5 - c, 2) / 2)))
      document.getElementById("crystalupgradedescription").textContent = w
      document.getElementById("crystalupgradeslevel").textContent = "Level: " + p;
      document.getElementById("crystalupgradescost").textContent = "Cost: " + format(q) + " crystals"
  }
  
  
  
  function upgradeupdate(num, fast) {
      var x = "upg"+num
      if (player.upgrades[num] > 0.5 && ((num <= 60 || num > 80) && (num <= 93 || num > 100))) {
      document.getElementById(x).style.backgroundColor = "green"
      }
      if (player.upgrades[num] > 0.5 && ((num > 60 && num <= 80) || (num > 93 && num <= 100))) {
      document.getElementById(x).style.backgroundColor = "white"
      }
      var a = "upgdesc" + num
      var b = window[a]
      var c = ""
      if (player.upgrades[num] > 0.5) {
          c = c + " BOUGHT!"
      
      if (!fast) {    
      document.getElementById("upgradedescription").textContent = b + c
      document.getElementById("upgradedescription").style.color = "gold"
      }
      }    
      else {document.getElementById(x).style.backgroundColor = "Black"}
  
      if (!fast) revealStuff()
  }
  
  var resdesc1 = "Increase the number of free Accelerators gained by 20% from all sources."
  var resdesc2 = "Increase the number of free Multipliers gained by 20% from all sources."
  var resdesc3 = "Increase the number of free Accelerator Boosts gained by 20% from all sources."
  var resdesc4 = "Increase most rune effects by 10%. (Excludes any recycle chance bonus)"
  var resdesc5 = "Multiply the production of all crystal producers by 1e4."
  var resdesc6 = "Gain +5% free accelerators per level."
  var resdesc7 = "Gain +1.25% free accelerators per level."
  var resdesc8 = "Gain +0.66% free accelerators per level."
  var resdesc9 = "Gain +0.375% free accelerators per level."
  var resdesc10 = "Gain +0.2% free accelerators per level."
  var resdesc11 = "Gain +5% free multipliers per level."
  var resdesc12 = "Gain +2.5% free multipliers per level."
  var resdesc13 = "Gain +0.5% free multipliers per level."
  var resdesc14 = "Gain +0.25% free multipliers per level."
  var resdesc15 = "Gain +0.2% free multipliers per level."
  var resdesc16 = "Gain +1% free accelerator boosts per level."
  var resdesc17 = "Gain +1% free accelerator boosts per level."
  var resdesc18 = "Gain +2 free accelerator per accelerator boost."
  var resdesc19 = "Gain +2 free accelerator per accelerator boost."
  var resdesc20 = "Gain +3 free accelerator per accelerator boost!"
  var resdesc21 = "Most rune effects are increased by 0.125% per level. (Excludes any recycle chance bonus)"
  var resdesc22 = "Each Offering used increases Rune EXP by 3 per level."
  var resdesc23 = "Each Offering used increases Rune EXP by another 2 per level!"
  var resdesc24 = "Prestige and Transcensions base Offering is increased by 1 per level. (Affected by time factor!)"
  var resdesc25 = "Reincarnation and [???] base Offering is increased by 3 per level. (Affected by time factor!)"
  var resdesc26 = "Multiply all crystal producer production by 10% per level."
  var resdesc27 = "Multiply all crystal producer production by 5% per level."
  var resdesc28 = "Coin Exponent is increased by 0.02 per level."
  var resdesc29 = "Coin Exponent is increased by another 0.02 per level."
  var resdesc30 = "Coin Exponent is increased by ANOTHER 0.01 per level."
  var resdesc31 = "When offline for greater than 1 hour you gain +5% of best obtainium per second per level [Max 50%]."
  var resdesc32 = "Offline production is increased by another 5% of best obtainium per second per level [Max 100%]."
  var resdesc33 = "Gain +2% more multiplier boosts from Mythos Shards per level."
  var resdesc34 = "Gain another +2% more multiplier boosts from Mythos Shards per level (stacks with other research)."
  var resdesc35 = "Gain ANOTHER +2% more multiplier boosts from Mythos Shards per level (stacks with other researches)."
  var resdesc36 = "Building power scales 1% faster per level."
  var resdesc37 = "Building power scales .5% faster per level."
  var resdesc38 = "Building power scales .5% faster per level."
  var resdesc39 = "Building power affects crystal production at a reduced rate."
  var resdesc40 = "Building power affects mythos shard production at a reduced rate."
  var resdesc41 = "Start Reincarnations with automatic A.Boosts unlocked. Note: this research doesn't affect earning achievements."
  var resdesc42 = "Start Reincarnations with automatic Generators unlocked."
  var resdesc43 = "Start Reincarnations with automatic C.Upgrades unlocked."
  var resdesc44 = "Start Reincarnations with automatic D.Upgrades unlocked."
  var resdesc45 = "Start Reincarnations with automatic Diamond production unlocked."
  var resdesc46 = "Unlock the ability to automatically Reincarnate!"
  var resdesc47 = "Unlock Reincarnation upgrades 1-5. [Upgrades cost between 1 and 1,000 Particles]"
  var resdesc48 = "Unlock Reincarnation upgrades 6-10. [Upgrades cost between 100,000 and 1e22 Particles]"
  var resdesc49 = "Unlock Reincarnation upgrades 11-15. [Upgrades cost between 1e30 and 1e60 Particles]"
  var resdesc50 = "Unlock Reincarnation upgrades 16-20. [You might want to wait until challenge 8 is doable!]"
  var resdesc51 = "Taxation scales 5.0% slower per level. [Up to -50%]"
  var resdesc52 = "Taxation scales 2.5% slower per level. [Up to -75%]"
  var resdesc53 = "Taxation scales 1.25% slower per level. [Up to -87.5%]"
  var resdesc54 = "Taxation scales 0.625% slower per level. [Up to -93.75%]"
  var resdesc55 = "Taxation scales 0.3125% slower per level. [Up to -96.875%]"
  var resdesc56 = "Building Cost Scale is delayed by 0.5% per level."
  var resdesc57 = "Building Cost Scale is delayed by 0.5% per level."
  var resdesc58 = "Building Cost Scale is delayed by 0.5% per level."
  var resdesc59 = "Building Cost Scale is delayed by 0.5% per level."
  var resdesc60 = "Building Cost Scale is delayed by 0.5% per level."
  var resdesc61 = "Unlock the ability to automatically gain Obtainium! The base rate is 1 per 60 seconds."
  var resdesc62 = "Lower the required amount of time to automatically gain obtainium by 1 second per level."
  var resdesc63 = "Lower the required amount of time to automatically gain obtainium again, by 1 second per level."
  var resdesc64 = "Gain +1 obtainium per level when you automatically gain them."
  var resdesc65 = "Increase the rate of gaining obtainium through reincarnations by 2% per level."
  var resdesc66 = "Increase the maximum number of [No Multipliers] completions by 1 per level."
  var resdesc67 = "Increase the maximum number of [No Accelerators] completions by 1 per level."
  var resdesc68 = "Increase the maximum number of [No Shards] completions by 1 per level."
  var resdesc69 = "Increase the maximum number of [Cost+] completions by 1 per level."
  var resdesc70 = "Increase the maximum number of [Diamond-] completions by 1 per level."
  var resdesc71 = "Automatically gain completions for Challenge 1, even without running it!"
  var resdesc72 = "Automatically gain completions for Challenge 2, even without running it!"
  var resdesc73 = "Automatically gain completions for Challenge 3, even without running it!"
  var resdesc74 = "Automatically gain completions for Challenge 4, even without running it!"
  var resdesc75 = "Automatically gain completions for Challenge 5, even without running it!"
  var resdesc76 = "Welcome to the land of expensive researches. Here's +1% obtainium everywhere per level to help you out! (Stacks multiplicatively)"
  var resdesc77 = "Increase the level cap of Thrift rune by 1 per level, and +0.4% exp for that rune in particular."
  var resdesc78 = "Increase the level cap of Speed rune by 1 per level, and +0.4% exp for that rune in particular."
  var resdesc79 = "Increase the level cap of Prism rune by 1 per level, and +0.4% exp for that rune in particular."
  var resdesc80 = "Increase the level cap of Duplication rune by 1 per level, and +0.4% exp for that rune in particular."
  var resdesc81 = "You thought the previous researches are expensive? You're going to need this! [+0.5% Obtainium/level]"
  var resdesc82 = "Permanently UNLOCK the Rune of Superior Intellect! [+%Ob / +Ant Speed / +Offering Timer Ext.]"
  var resdesc83 = "Taking forever to level up that SI Rune? Here's +2% SI Rune EXP per level."
  var resdesc84 = "Does the new rune kinda suck? Power it up! +0.1% level effectiveness for SI rune per level!"
  var resdesc85 = "You'll love this. Improve time itself by making offering gain better for another +6 seconds before diminishing returns per level."
  var resdesc86 = "Yeah, going back to basics. +1% Accelerators/Level."
  var resdesc87 = "0/5 Multipliers SUCK: +1% Multipliers/Level."
  var resdesc88 = "-1/5 A.Boosts SUCK: +1% Accelerator Boosts/Level."
  var resdesc89 = "-5/5 MULTIPLIERS STILL SUCK: +4% Multiplier Boosts/Level"
  var resdesc90 = "Runes don't suck at all, but why not make them even BETTER? +1% Rune Effect/level!"
  var resdesc91 = "As lazy as this icon. A simple +1% Rune EXP for all runes!"
  var resdesc92 = "Even lazier! Another simple +1% Rune EXP for all runes!"
  var resdesc93 = "It's like I wasn't even trying. +1 Accelerator Boost per 100 Summative Rune Levels, per level."
  var resdesc94 = "The power of laziness benefits you. +100 Multiplier per 100 Summative Rune Levels, per level."
  var resdesc95 = "Gain +40 base Offerings from Reincarnations by purchasing this. Math Nerds will love this!"
  var resdesc96 = "Ants slow? Add +0.00005 to ant efficiency increase per ant purchased per level."
  var resdesc97 = "Add +1 level to the first six upgradable ants per level!"
  var resdesc98 = "Add +1 level to the next five upgradable ants per level!"
  var resdesc99 = "Is the Quark Shop too hot to resist? Get +1 Quark per hour from Exporting for each level (Up to +75)!"
  var resdesc100 = "Alright, Platonic is off his rocker. I don't expect you to get this but this will give +1 MORE Quark per hour from Exporting (Up to +100)!"
  var resdesc101 = "Alright, you're past the big wall. How about adding +.001 to Inceptus Ant efficiency per level?"
  var resdesc102 = "Gain +1 bonus level to ALL ants per level! A rainbow attack!"
  var resdesc103 = "Pray to Ant God for +2% sacrifice rewards per level!"
  var resdesc104 = "You're beginning to feel like an ant god (ant god): +2% sacrifice reward per level!"
  var resdesc105 = "Buy this and be able to run the first five challenges infinitely! (Note that requirements scale a LOT faster after 75)"
  var resdesc106 = "Engrave your talismans with obtainium to get +0.01 Rune Levels per talisman level per level."
  var resdesc107 = "Refine your talismans with the powder of Obtainium to get +0.01 Rune Levels per talisman level per level again."
  var resdesc108 = "A simple trick makes your base ant ELO increase by 5 per level!"
  var resdesc109 = "A more convoluted trick makes your base ant ELO increase by 5 per level again!"
  var resdesc110 = "Gain +1% more ELO from ant sources per level because why not?"
  var resdesc111 = "Gotta go fast [+1 max Speed Rune Level per level]"
  var resdesc112 = "Double Trouble [+1 max Duplication Rune level per level]"
  var resdesc113 = "Newton's Delight [+1 max Prism Rune Level per level]"
  var resdesc114 = "Five-Finger discounts [+1 max Thrift Rune Level per level]"
  var resdesc115 = "Scientific Breakthrough [+1 max SI Rune Level per level]"
  var resdesc116 = "Permanently gain 10% of your Obtainium/sec automatically, without needing to Reincarnate!"
  var resdesc117 = "Add +2% to automatic Obtainium gain."
  var resdesc118 = "Add another +2% to automatic Obtainium gain!"
  var resdesc119 = "Gain +2% [Ascend reward] per level upon Ascension."
  var resdesc120 = "Gain another +2% [Ascend reward] per level upon Ascension."
  var resdesc121 = "Bend time to your will, making all ticks 2% faster each level."
  var resdesc122 = "Adds +1% ant sacrifice reward per level."
  var resdesc123 = "Adds +10 base ant ELO per level."
  var resdesc124 = "Unlock the automator for Ant Sacrifice! [Good luck buying this.]"
  var resdesc125 = "Good luck, buddy. [+1 Export Quark/hour]"
  function researchdescriptions(i,auto) {
      auto = auto || false
      var x = "resdesc" + i
      var y = window[x]
      var z = ""
      var p = "res" + i
      z = " Cost: " + (format(researchBaseCosts[i],0,true)) + " Obtainium" 
      if (player.researches[i] == researchMaxLevels[i]) {
          document.getElementById("researchcost").style.color = "Gold"
          document.getElementById("researchinfo3").style.color = "plum"
          z = z + " || MAXED!"}
      else {document.getElementById("researchcost").style.color = "limegreen"
            document.getElementById("researchinfo3").style.color = "white"}
      
      if (player.researchPoints < researchBaseCosts[i] && player.researches[i] < researchMaxLevels[i]){document.getElementById("researchcost").style.color = "crimson"}
  
      if (!auto && !player.autoResearchToggle){
      if (player.researches[i] > 0.5 && player.researches[i] < researchMaxLevels[i]) {document.getElementById(p).style.backgroundColor = "purple"}
      if (player.researches[i] > 0.5 && player.researches[i] >= researchMaxLevels[i]) {document.getElementById(p).style.backgroundColor = "green"}
      }
      document.getElementById("researchinfo2").textContent = y
      document.getElementById("researchcost").textContent = z
      document.getElementById("researchinfo3").textContent = "Level " + player.researches[i] + "/" + researchMaxLevels[i]
  }
  