Renamed curveFitting to linearRegression and implemented algorithm