rewrite whole