nelder mead accuracy problem solved