rewrite almost all