rewrite vm