Implemented the winner logic.