abstract out strategy for calculating various sums in sim-pearson