Added the ability to choose the sort order of the sequence.