Part 2: Game loop