use the right file
write out the file