wrote templat IO