Understanding least squares