This also applies to the logfile input (where I copied these portions from).