using sortUsingComparator