write files to output