It probably makes more sense to check for a game over condition before checking for a tie.