Added sorting functionality - alphabetically and based on the attribute being typed.