working on pairwise stuff