write out keyvalues