closes #7, writes CSVs optionally