code for operations on a vm