Termination Bug fixed

- The programm now terminates, after the last result is written into the output file