Added helper functions for csv file writing
Fully working csv write functions for multiple file formats