rewrite exercises