Least Squares Formula Explained