writes new text to file in output directory