fix leastSquares in line class