Added sorting capability.