First parts of game logic