Added tables and table sorting