fix covariance & correlation calculation