added a log file output to code