code in Gamelogic