added another run example and improved log file writing