add minimax algorithm