Added function for the least squares polynomials