added table sorting