cleaning up code of covariance matrix functions, now that Sebastian has fixed the problem