rewrite to suit new log.txt formatting