I can write data to a csv file although still have to work on the format