rewriting doc