do entire calculation of pearson coefficient in separate method