tidied the covariance code
cov