added log to save output and config file to save program configurations