text file creation working, still need to refactor