re rewrite