Implemented VM with tests