[sort] greatly simplified sort function

same functionality, 100% less verbose