refactored play_game