This is a pretty clever way of getting around the padding problem, though it will traverse the tuples that share the same prefix twice.

If the sort order is DESC, how does it know to do reverse traversal below?