Added sorting to events