added new csv writing