notebook on least squares theory