some nelder mead changes