changed weighting method to pairwise