minimax algorithm updated