Fix
fix
Refactor sorting