rewrite analysis