determines the winner