Remove duplicate functions.
Update examples.
Update line search code.