Re-wrote the scan_log.txt creation to use proper flow control. We now combine to whole log into an array before writing it to the file all at once