sort the catalogue by length

also return length, offset, and indices for quickly locationg
particles in a group.
remove a debug message