move findPairs def to .cc file