corrected game logic