Added sorting stuff for Selection