Added sorting toggle feature