Added sorting function for products