computing the correlation