Implement sorting for categories
Manual added