fixed bug in best-fit minimizer