Most of game logic done