Added recursive Algorithm for least squares