Seems like the best way to handle this would be with a Set, which can be sorted. Sorting within an individual block’s contents could be challenging. Sorting between multiple blocks might be easier (based only on first characters of the entire block, of course). But still seems quite specialized.