added table-writing script