Added isGameOver function to check for board state