added logging script and output file