tutorial, more numerically stable lstsq