added code for linear regression