rewrite vm
some more tests