Added export to CSV file functionality.