nelder_mead test modified