Restored NLS function to fix error of: fail to use nls!