replace 'Nelder-Mead' with solver