First implementation of linear regression