Added sorting capabilities.