Sort function working with simple ascending/descending