Add missing bit where average pearson is calculated and stored.