more efficient by using unique pairs.