Modification of CSV output routines to fit new structure