rewrite done