Unmodified WriteToCSV.py that was created by Alan