fixed the problems with minimax