changed code to generate data file (data.txt) on first run