implement a simple VM