Added parts of game logic