Re-order table to be sorted