simple function to compute all pairwise correlations