Added sorting to the top table