Bug fix the minimax algorithm