Some work on the main game flow.