less debugging
don't include x0 in the line search to be less likely to get into loops
restructure flow