added CSV file output functions