fixed a VM bug, added some documentation