clean up
fixing if condition in line search