Revert "Revert "change sort method""

This reverts commit a8e861914410df1a7fada2711f2697e96b2c6d83.