fixed Math.min to Math.max ensuring that addGold or addElement wont receive negative argument.