public Object getVariable(String name) {
        if(variables.containsKey(name)) {
            return variables.get(name);
        }
        else if(parent!=null) {
            return parent.getVariable(name);
        }
        else
            throw new RuntimeException("Variable <" + name + "> undefined");
    }