programming exercise 3 -- linear regression