add isSorted in tests