added code from vm