Now writes output to csv file.