explain the rewrite part