Function PRIORITY_COMPARATOR