draw diagram rewrite