Write final output as .txt