Finished rewrite