Improve the performance of the Minimax alogrithm