output.txt bug fixed