solvingtheleastsquareproblems