updated sorting functions
sorting functional
Merge pull request #77 from wlabranche/sorting

Sorting