added while and for loop handling
made some fixes regarding errors in vm code