Added functions to check if the game is won/tied.