Added class method write_tables.