covariance and averaging fix