a line search based optimization code