add printing to output.txt