used maxevals instead of ftol and xtol (not sure how the latter work in terms o f simplex)