code review of LeastSquares