begin minimax