write the files