rewrite contents