updated with file creation functionality

generates the correct csv file