Added sorting of the selection table