added the ability to export the data to csv