add write-to-file function to converted result