Implemented isDag (not yet tested)