Added sorting by categories