add option to store the output in a csv file