programmed an automatic report-writing code