fixed sort
Merge pull request #97 from wlabranche/bugfix-sorting

updated sorting