working on data output to file