Made the script checks for a win before a tie.