Finished linear regression implementation.