generating csv to store data