added list function and storing in CSV file