Now writes the output as a txt file, not csv