Changing the main.cpp to save the output into a txt.