fixing minimizer logic