Index: molecuilder/src/moleculelist.cpp
===================================================================
--- molecuilder/src/moleculelist.cpp	(revision a3ff7b27b58f3cdb07fefe9019035a3e59d02342)
+++ molecuilder/src/moleculelist.cpp	(revision 2700f5e8503e241df1a32670f3b34cb204c5d0a2)
@@ -409,36 +409,30 @@
  * \param *&RootStack stack to be filled
  * \param *AtomMask defines true/false per global Atom::nr to mask in/out each nuclear site
- * \param Order desired bond order for all sites 
  * \param &FragmentCounter counts through the fragments in this MoleculeLeafClass
  * \return true - stack is non-empty, fragmentation necessary, false - stack is empty, no more sites to update
  */
-bool MoleculeLeafClass::FillRootStackForSubgraphs(ofstream *out, KeyStack *&RootStack, bool *AtomMask, int Order, int &FragmentCounter)
+bool MoleculeLeafClass::FillRootStackForSubgraphs(ofstream *out, KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter)
 {
   atom *Walker = NULL, *Father = NULL;
 
   if (RootStack != NULL) {
-    if (Order == -1) {  // means we want to increase order adaptively
-      cerr << "Adaptive chosing of sites not yet implemented!" << endl;
-    } else {  // means we just want to increase it at every site by one
-      // find first root candidates 
-      if (&(RootStack[FragmentCounter]) != NULL) {
-        RootStack[FragmentCounter].clear();  
-        Walker = Leaf->start;
-        while (Walker->next != Leaf->end) { // go through all (non-hydrogen) atoms
-          Walker = Walker->next;
-          Father = Walker->GetTrueFather();
-          if (AtomMask[Father->nr]) // apply mask
-      #ifdef ADDHYDROGEN
-            if (Walker->type->Z != 1) // skip hydrogen
-      #endif
-              if (Father->AdaptiveOrder < Order) // only if Order is still greater
-                RootStack[FragmentCounter].push_front(Walker->nr);
-        }
-        if (next != NULL)
-          next->FillRootStackForSubgraphs(out, RootStack, AtomMask, Order, ++FragmentCounter);
-      }  else {
-        *out << Verbose(1) << "Rootstack[" << FragmentCounter  << "] is NULL." << endl;
-        return false;
-      }
+    // find first root candidates 
+    if (&(RootStack[FragmentCounter]) != NULL) {
+      RootStack[FragmentCounter].clear();  
+      Walker = Leaf->start;
+      while (Walker->next != Leaf->end) { // go through all (non-hydrogen) atoms
+        Walker = Walker->next;
+        Father = Walker->GetTrueFather();
+        if (AtomMask[Father->nr]) // apply mask
+    #ifdef ADDHYDROGEN
+          if (Walker->type->Z != 1) // skip hydrogen
+    #endif
+            RootStack[FragmentCounter].push_front(Walker->nr);
+      }
+      if (next != NULL)
+        next->FillRootStackForSubgraphs(out, RootStack, AtomMask, ++FragmentCounter);
+    }  else {
+      *out << Verbose(1) << "Rootstack[" << FragmentCounter  << "] is NULL." << endl;
+      return false;
     }
     FragmentCounter--;
@@ -553,11 +547,15 @@
 {
   KeySet *TempSet = new KeySet;
-  for(Graph::iterator runner = FragmentList[FragmentCounter]->begin(); runner != FragmentList[FragmentCounter]->end(); runner++) {
-    for(KeySet::iterator sprinter = (*runner).first.begin(); sprinter != (*runner).first.end(); sprinter++)
-      TempSet->insert((Leaf->FindAtom(*sprinter))->GetTrueFather()->nr);
-    TotalGraph.insert(GraphPair(*TempSet, pair<int,double>(TotalNumberOfKeySets++, (*runner).second.second)));
-    TempSet->clear();
-  }
-  delete(TempSet);
+  if (FragmentList[FragmentCounter] != NULL) {
+    for(Graph::iterator runner = FragmentList[FragmentCounter]->begin(); runner != FragmentList[FragmentCounter]->end(); runner++) {
+      for(KeySet::iterator sprinter = (*runner).first.begin(); sprinter != (*runner).first.end(); sprinter++)
+        TempSet->insert((Leaf->FindAtom(*sprinter))->GetTrueFather()->nr);
+      TotalGraph.insert(GraphPair(*TempSet, pair<int,double>(TotalNumberOfKeySets++, (*runner).second.second)));
+      TempSet->clear();
+    }
+    delete(TempSet);
+  } else {
+    *out << Verbose(1) << "FragmentList is NULL." << endl;
+  }
   if (next != NULL)
     next->TranslateIndicesToGlobalIDs(out, FragmentList, ++FragmentCounter, TotalNumberOfKeySets, TotalGraph);
