write out files