added export to csv functionality part 1