Added switch to maintain index association while sorting.
Merge pull request #1 from TiS/master

Added switch to maintain index association while sorting.