Modify code to add headers to csv files