String attribute_name = r.getVariableName();
    protected Variable getVariable( VariableReference r, Context c ) throws LemRuntimeException {        String name = r.getObjectName();        Variable destination;                if ( name != null ) {            // if variable the attribute of the current object            if(name.equals("self") && (currentObject != null)) {                String attribute_name = r.getVariableName();                destination = currentObject.getAttribute( attribute_name );                if ( destination == null ) {                    throw new LemRuntimeException( "Attribute '" + r.getVariableName() + "' not defined on object named '" + name + "'" );                }                // we are reading a atribute                if(!attributeWrite) {                     new LemAttributeReadEvent(currentObject.getObjectId().intValue(), attribute_name, destination.getValue()).notifyAll( c );                }                return destination;            }                        // Look up the object reference in the current context            Variable v = c.getVariable( name );            if ( v == null ) {                throw new LemRuntimeException( "Variable '" + name + "' is not defined" );            }                        if ( !( v.getType().equals( ObjectReferenceType.getInstance() ) ) ) {                throw new LemRuntimeException( "Variable '" + name + "' is not an object reference" );            }                        // OK, we've got a valid object reference            // TODO: What if the referenced object has been deleted or reclassified?            // Why is life so complex?            runtime.Object source = ( runtime.Object ) ( v.getValue() );                        // Now we've got the target object. We need to get the named attribute from that object.            String attribute_name = r.getVariableName();            destination = source.getAttribute( attribute_name );            if ( destination == null ) {                throw new LemRuntimeException( "Attribute '" + r.getVariableName() + "' not defined on object named '" + name + "'" );            }            // we are reading a atribute            if(!attributeWrite) {                 new LemAttributeReadEvent(source.getObjectId().intValue(), attribute_name, destination.getValue()).notifyAll( c );            }        } else {		destination = c.getVariable( r.getVariableName() );		if (destination == null)			throw new LemRuntimeException("Variable " + r.getVariableName() + " is NULL");        }                return destination;    }