Ported table-sort