Added leastSquares and predict functions