Modified Linear Regression Code

Still diverges, but less so. Possible issue with shear scale. Maybe
build in automatic test for convergence?