added the option of generating a report file