added print_tables and index