added output per txt function