debug build_tables