moved new optional argument 'step' for nelder-mead minimize
to the end

changed codes to follow the idiomatic Python style