output file was being clobbered, changed to flushing after each result, can just accumulate data post-processing