calculating correlations