fixed winning and cat's game logic