adapted to new tables and enhanced ui