Added sorting for the table