preparing functions to include csv-part into main program