working on covariance matrix