implemented linear regression