Added comments to findSimilarPairs function