adding least squares