broke down play_game function, fixed a bug in playgame