rewrite for valuepair