hooking up the rewrite