/** Decrease number of users; if zero, remove this algo from kernel */
  public void removeUser() {
    numberOfUsers--;

    if (numberOfUsers == 0 && !isPrintedInXML()) {
      //  this algorithm has no users and no labeled output
      super.remove();
      kernel.getAlgoDispatcher().removeIntersectionAlgorithm(this);
    }
  }
 @Override
 public void remove() {
   if (removed) return;
   if (numberOfUsers == 0) {
     //  this algorithm has no users and no labeled output
     super.remove();
     kernel.getAlgoDispatcher().removeIntersectionAlgorithm(this);
   } else {
     // there are users of this algorithm, so we keep it
     // remove only output
     // delete dependent objects
     for (int i = 0; i < getOutputLength(); i++) {
       getOutput(i).doRemove();
     }
     setPrintedInXML(false);
   }
 }