Added nelder mead optimization