Improved the heuristic function of the AIPlayer.