Refactor the sorting code
Merge pull request #102 from flagbug/improve-sorting

Refactor the sorting code