public boolean equals(Object o) {
        if ( !(o instanceof ISEAbstractState) ) return false;
        ISEAbstractState s = (ISEAbstractState)o;
        if ( depth != s.depth ) return false;
        // check that the elements are the same
        for ( int cntr = 0; cntr < elements.length; cntr++ ) {
            if( elements[cntr].read != s.elements[cntr].read ) return false;
            if( elements[cntr].value != s.elements[cntr].value ) return false;
        }
        // check that the stack contents are the same
        for ( int cntr = 0; cntr < depth; cntr++ ) {
            if( stack[cntr] != s.stack[cntr] ) return false;
        }
        return true;
    }