implement Spearman and Pearson correlation