Added sorting to categories