Add facility to output as a csv file