edited covariance calculation more; cancelled terms