removed isSorted