Some work on the main game logic