add a isSorted() method