Added sorting to beamer