 
 clickUpg = (n) ->
   if money >= clickcosts[n]
-    money -= clickcost[n]
+    money -= clickcosts[n]
     clickupgs[n] += 1
     incamount *= clickeffects[n]
     $("#clickupg" + (n + 1)).hide()
   else
     window.alert "You do not have enough money."
-   
+ 
+# Hover-box: Buildings
 hoverFuncBuild = (n) ->
   boughtupgs = []
   upgcheck = 0

  if boughtupgs.length == 0
    boughtupgs.push("None yet!")
  boughtupgs = boughtupgs.join("<br>")
  $("#hoverinfo").html buildnames[n] + "<br>Amount: " + amounts[n] + "<br>Total MPS: " + (amounts[n] * mpsadds[n]).toFixed(1) + "<br>Upgrades unlocked:<br>" + boughtupgs
  
hoverFuncUpg = (n, step) ->
  if n == -1
    hovertemp1 = clicknames[step]

    hovertemp3 = upgeffects[n][step] + "MPS"
  $("#hoverinfo").html hovertemp1 + "<br>Effects:<br>" + hovertemp2 + " * " + hovertemp3
  
# Removes the hover-text.
hoverRemove = ->
  $("#hoverinfo").html "Hover over something!"
