Adding gamestate functionality