Refactoring minimax
Minimax Worksgst