rewrite tutorial