Trying to implement linear regression with extension to high dimention and high degree of basis functions