sort with comparator