Re-added secondary table and added tablesort.