Refactored minimax_alpha_beta method.