Modified linear regression to use the matrix repo