revised to spit data directly to CSV, instead of marshaling it in memory