changed new-vm algorithm