Added function to return a .csv file as output of the script