Initial build of rewrite
Continued rewriting