initial export to csv functionality