Add checkForEndOfGame() function.