my first attempt to write a virtual machine