least squares works