Refactor linear_regression.m