WIP: write csv files almost properly, need to add titles.