updated for case of matching counts but differing sums