Added the sorting for the table.