added ability to log generated data in csv file