starting rewrite