Chapter 2 through isSorted