> What about using new type and sort the pair before comparing? > sort the values in the pairs and then apply compare between them now I see what Petr meant. Thank you