Changed line search routine.