Index: src/builder.cpp
===================================================================
--- src/builder.cpp	(revision ba4432331924fc02b7f5a1f24643fb79bc770fb4)
+++ src/builder.cpp	(revision df793af37622fc6e5428ad9e5627590d46749e75)
@@ -953,16 +953,29 @@
                 cout << Verbose(1) << "Depth-First-Search Analysis." << endl;
                 MoleculeLeafClass *Subgraphs = NULL;      // list of subgraphs from DFS analysis
-                int *MinimumRingSize = NULL;
+                int *MinimumRingSize = new int[mol->AtomCount];
+                atom ***ListOfLocalAtoms = NULL;
+                int FragmentCounter = 0;
+                class StackClass<bond *> *BackEdgeStack = NULL;
+                class StackClass<bond *> *LocalBackEdgeStack = NULL;
                 mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr]), configuration.GetIsAngstroem());
                 mol->CreateListOfBondsPerAtom((ofstream *)&cout);
-                Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, MinimumRingSize);
-                delete[](MinimumRingSize);
+                Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, BackEdgeStack);
                 if (Subgraphs != NULL) {
+                  Subgraphs->next->FillBondStructureFromReference((ofstream *)&cout, mol, (FragmentCounter = 0), ListOfLocalAtoms, false);  // we want to keep the created ListOfLocalAtoms
                   while (Subgraphs->next != NULL) {
                     Subgraphs = Subgraphs->next;
+                    LocalBackEdgeStack = new StackClass<bond *> (Subgraphs->Leaf->BondCount);
+                    Subgraphs->Leaf->PickLocalBackEdges((ofstream *)&cout, ListOfLocalAtoms[FragmentCounter++], BackEdgeStack, LocalBackEdgeStack);
+                    Subgraphs->Leaf->CyclicStructureAnalysis((ofstream *)&cout, BackEdgeStack, MinimumRingSize);
+                    delete(LocalBackEdgeStack);
                     delete(Subgraphs->previous);
                   }
                   delete(Subgraphs);
+                  for (int i=0;i<FragmentCounter;i++)
+                    Free((void **)&ListOfLocalAtoms[FragmentCounter], "ParseCommandLineOptions: **ListOfLocalAtoms[]");
+                  Free((void **)&ListOfLocalAtoms, "ParseCommandLineOptions: ***ListOfLocalAtoms");
                 }
+                delete(BackEdgeStack);
+                delete[](MinimumRingSize);
               }
               argptr+=1;
@@ -1255,7 +1268,8 @@
   int Z;
   int j, axis, count, faktor;
-  int *MinimumRingSize = NULL;
+  clock_t start,end;
+//  int *MinimumRingSize = NULL;
   MoleculeLeafClass *Subgraphs = NULL;
-  clock_t start,end;
+//  class StackClass<bond *> *BackEdgeStack = NULL;
   element **Elements;
   Vector **vectors;
@@ -1423,19 +1437,22 @@
        
       case 'o': // create the connection matrix
-        cout << Verbose(0) << "What's the maximum bond distance: ";
-        cin >> tmp1;
-        start = clock();
-        mol->CreateAdjacencyList((ofstream *)&cout, tmp1, configuration.GetIsAngstroem());
-        //mol->CreateListOfBondsPerAtom((ofstream *)&cout);
-        Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, MinimumRingSize);
-        while (Subgraphs->next != NULL) {
-          Subgraphs = Subgraphs->next;
-          delete(Subgraphs->previous);
+        {
+          cout << Verbose(0) << "What's the maximum bond distance: ";
+          cin >> tmp1;
+          start = clock();
+          mol->CreateAdjacencyList((ofstream *)&cout, tmp1, configuration.GetIsAngstroem());
+          mol->CreateListOfBondsPerAtom((ofstream *)&cout);
+//          Subgraphs = mol->DepthFirstSearchAnalysis((ofstream *)&cout, BackEdgeStack);
+//          while (Subgraphs->next != NULL) {
+//            Subgraphs = Subgraphs->next;
+//            Subgraphs->Leaf->CyclicStructureAnalysis((ofstream *)&cout, BackEdgeStack, MinimumRingSize);
+//            delete(Subgraphs->previous);
+//          }
+//          delete(Subgraphs);    // we don't need the list here, so free everything
+//          delete[](MinimumRingSize);
+//          Subgraphs = NULL;
+          end = clock();
+          cout << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
         }
-        delete(Subgraphs);    // we don't need the list here, so free everything
-        delete[](MinimumRingSize);
-        Subgraphs = NULL;
-        end = clock();
-        cout << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;
         break;
         
Index: src/helpers.hpp
===================================================================
--- src/helpers.hpp	(revision ba4432331924fc02b7f5a1f24643fb79bc770fb4)
+++ src/helpers.hpp	(revision df793af37622fc6e5428ad9e5627590d46749e75)
@@ -100,4 +100,6 @@
     status = false;
   } else {
+    for (int i=0;i<count;i++)
+      LookupTable[i] = NULL;
     Walker = start;
     while (Walker->next != end) { // create a lookup table (Atom::nr -> atom) used as a marker table lateron 
Index: src/moleculelist.cpp
===================================================================
--- src/moleculelist.cpp	(revision ba4432331924fc02b7f5a1f24643fb79bc770fb4)
+++ src/moleculelist.cpp	(revision df793af37622fc6e5428ad9e5627590d46749e75)
@@ -589,13 +589,13 @@
     while (Walker->next != Leaf->end) {
       Walker = Walker->next;
-      AtomNo = Walker->father->nr;  // global id of the current walker
+      AtomNo = Walker->GetTrueFather()->nr;  // global id of the current walker
       for(int i=0;i<reference->NumberOfBondsPerAtom[AtomNo];i++) { // go through father's bonds and copy them all
         Binder = reference->ListOfBondsPerAtom[AtomNo][i];
-        OtherWalker = ListOfLocalAtoms[FragmentCounter][Binder->GetOtherAtom(Walker->father)->nr];    // local copy of current bond partner of walker
+        OtherWalker = ListOfLocalAtoms[FragmentCounter][Binder->GetOtherAtom(Walker->GetTrueFather())->nr];    // local copy of current bond partner of walker
         if (OtherWalker != NULL) {
           if (OtherWalker->nr > Walker->nr)
           Leaf->AddBond(Walker, OtherWalker, Binder->BondDegree);
         } else {
-          *out << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << FragmentCounter << "][" << Binder->GetOtherAtom(Walker->father)->nr << "] is NULL!" << endl;
+          *out << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << FragmentCounter << "][" << Binder->GetOtherAtom(Walker->GetTrueFather())->nr << "] is NULL!" << endl;
           status = false;
         }
@@ -608,8 +608,9 @@
   }
   
+  FragmentCounter--;
   if (FreeList) {
     // free the index lookup list
     Free((void **)&ListOfLocalAtoms[FragmentCounter], "MoleculeLeafClass::FillBondStructureFromReference - **ListOfLocalAtoms[]");
-    if (ListOfLocalAtoms[FragmentCounter] == NULL)
+    if (FragmentCounter == 0) // first fragments frees the initial pointer to list
       Free((void **)&ListOfLocalAtoms, "MoleculeLeafClass::FillBondStructureFromReference - ***ListOfLocalAtoms");
   }
@@ -661,10 +662,10 @@
  * \param *out output stream fro debugging
  * \param ***ListOfLocalAtoms Lookup table for each subgraph and index of each atom in global molecule, may be NULL on start, then it is filled
- * \param &FragmentCounter counts the fragments as we move along the list
+ * \param FragmentCounter counts the fragments as we move along the list
  * \param GlobalAtomCount number of atoms in the complete molecule
  * \param &FreeList true - ***ListOfLocalAtoms is free'd before return, false - it is not
  * \return true - succes, false - failure
  */
-bool MoleculeLeafClass::FillListOfLocalAtoms(ofstream *out, atom ***&ListOfLocalAtoms, int &FragmentCounter, int GlobalAtomCount, bool &FreeList)
+bool MoleculeLeafClass::FillListOfLocalAtoms(ofstream *out, atom ***&ListOfLocalAtoms, const int FragmentCounter, const int GlobalAtomCount, bool &FreeList)
 {
   bool status = true;
@@ -726,5 +727,5 @@
     KeySet *TempSet = new KeySet;
     for(Graph::iterator runner = KeySetList->begin();runner != KeySetList->end(); runner++) { // key sets contain global numbers!
-      if ( ListOfLocalAtoms[FragmentCounter][reference->FindAtom(*((*runner).first.begin()))->nr]->nr != -1) {// as we may assume that that bond structure is unchanged, we only test the first key in each set
+      if ( ListOfLocalAtoms[FragmentCounter][reference->FindAtom(*((*runner).first.begin()))->nr] != NULL) {// as we may assume that that bond structure is unchanged, we only test the first key in each set
         // translate keyset to local numbers
         for(KeySet::iterator sprinter = (*runner).first.begin(); sprinter != (*runner).first.end(); sprinter++)
@@ -744,8 +745,14 @@
     if (next != NULL)
       next->AssignKeySetsToFragment(out, reference, KeySetList, ListOfLocalAtoms, FragmentList, FragmentCounter, FreeList);
-    FragmentCounter--;
   } else
     *out << Verbose(1) << "KeySetList is NULL or empty." << endl;
   
+  FragmentCounter--;
+  if (FreeList) {
+    // free the index lookup list
+    Free((void **)&ListOfLocalAtoms[FragmentCounter], "MoleculeLeafClass::AssignKeySetsToFragment - **ListOfLocalAtoms[]");
+    if (FragmentCounter == 0) // first fragments frees the initial pointer to list
+      Free((void **)&ListOfLocalAtoms, "MoleculeLeafClass::AssignKeySetsToFragment - ***ListOfLocalAtoms");
+  }
   return status;
 };
Index: src/molecules.cpp
===================================================================
--- src/molecules.cpp	(revision ba4432331924fc02b7f5a1f24643fb79bc770fb4)
+++ src/molecules.cpp	(revision df793af37622fc6e5428ad9e5627590d46749e75)
@@ -2244,8 +2244,9 @@
   int *MinimumRingSize = NULL;
   MoleculeLeafClass *Subgraphs = NULL;
+  class StackClass<bond *> *BackEdgeStack = NULL;
   bond *Binder = first;
   if ((Binder->next != last) && (Binder->next->Type == Undetermined)) {
     *out << Verbose(0) << "No Depth-First-Search analysis performed so far, calling ..." << endl;
-    Subgraphs = DepthFirstSearchAnalysis(out, MinimumRingSize);
+    Subgraphs = DepthFirstSearchAnalysis(out, BackEdgeStack);
     while (Subgraphs->next != NULL) {
       Subgraphs = Subgraphs->next;
@@ -2260,4 +2261,5 @@
       No++;    
   }
+  delete(BackEdgeStack);
   return No;
 };
@@ -2341,4 +2343,5 @@
   double *matrix = ReturnFullMatrixforSymmetric(cell_size);
   Vector x;
+  int FalseBondDegree = 0;
  
   BondDistance = bonddistance; // * ((IsAngstroem) ? 1. : 1./AtomicLengthToAngstroem);
@@ -2359,5 +2362,5 @@
       j += i+1;
       divisor[i] = (int)floor(cell_size[j]/bonddistance); // take smaller value such that size of linked cell is at least bonddistance
-      *out << Verbose(1) << "divisor[" << i << "]  = " << divisor[i] << "." << endl;
+      //*out << Verbose(1) << "divisor[" << i << "]  = " << divisor[i] << "." << endl;
     }
     // 2a. allocate memory for the cell list
@@ -2384,5 +2387,5 @@
       }
       index = n[2] + (n[1] + n[0] * divisor[1]) * divisor[2];
-      *out << Verbose(1) << "Atom " << *Walker << " goes into cell number [" << n[0] << "," << n[1] << "," << n[2] << "] = " << index << "." << endl;
+      //*out << Verbose(1) << "Atom " << *Walker << " goes into cell number [" << n[0] << "," << n[1] << "," << n[2] << "] = " << index << "." << endl;
       // add copy atom to this cell
       if (CellList[index] == NULL)  // allocate molecule if not done
@@ -2426,5 +2429,5 @@
                         distance =   OtherWalker->x.PeriodicDistance(&(Walker->x), cell_size);
                         if ((OtherWalker->father->nr > Walker->father->nr) && (distance <= MaxDistance*MaxDistance) && (distance >= MinDistance*MinDistance)) { // create bond if distance is smaller
-                          *out << Verbose(0) << "Adding Bond between " << *Walker << " and " << *OtherWalker << "." << endl;
+                          //*out << Verbose(0) << "Adding Bond between " << *Walker << " and " << *OtherWalker << "." << endl;
                           AddBond(Walker->father, OtherWalker->father, 1);  // also increases molecule::BondCount
                           BondCount++;
@@ -2485,5 +2488,7 @@
               ListOfBondsPerAtom[Walker->nr][CandidateBondNo]->BondDegree++;
               *out << Verbose(2) << "Increased bond degree for bond " << *ListOfBondsPerAtom[Walker->nr][CandidateBondNo] << "." << endl;
-            }
+            } else
+              *out << Verbose(2) << "Could not find correct degree for bond " << *ListOfBondsPerAtom[Walker->nr][CandidateBondNo] << "." << endl;
+              FalseBondDegree++;
           }
 		    }
@@ -2492,5 +2497,5 @@
 		} else
 			*out << Verbose(1) << "BondCount is " << BondCount << ", no bonds between any of the " << AtomCount << " atoms." << endl;
-	  *out << Verbose(1) << "I detected " << BondCount << " bonds in the molecule with distance " << bonddistance << "." << endl;
+	  *out << Verbose(1) << "I detected " << BondCount << " bonds in the molecule with distance " << bonddistance << ", " << FalseBondDegree << " bonds could not be corrected." << endl;
 		
 	  // output bonds for debugging (if bond chain list was correctly installed)
@@ -2513,12 +2518,11 @@
  * We use the algorithm from [Even, Graph Algorithms, p.62].
  * \param *out output stream for debugging
- * \param *&MinimumRingSize contains smallest ring size in molecular structure on return or -1 if no rings were found
+ * \param *&BackEdgeStack NULL pointer to StackClass with all the found back edges, allocated and filled on return
  * \return list of each disconnected subgraph as an individual molecule class structure
  */
-MoleculeLeafClass * molecule::DepthFirstSearchAnalysis(ofstream *out, int *&MinimumRingSize)
-{
-  class StackClass<atom *> *AtomStack;
-  AtomStack = new StackClass<atom *>(AtomCount);
-  class StackClass<bond *> *BackEdgeStack = new StackClass<bond *> (BondCount);
+MoleculeLeafClass * molecule::DepthFirstSearchAnalysis(ofstream *out, class StackClass<bond *> *&BackEdgeStack)
+{
+  class StackClass<atom *> *AtomStack = new StackClass<atom *>(AtomCount);
+  BackEdgeStack = new StackClass<bond *> (BondCount);
   MoleculeLeafClass *SubGraphs = new MoleculeLeafClass(NULL);
   MoleculeLeafClass *LeafWalker = SubGraphs;
@@ -2652,5 +2656,5 @@
     LeafWalker->Leaf->Output(out);
     *out << endl;
-    
+
     // step on to next root
     while ((Root != end) && (Root->GraphNr != -1)) {
@@ -2670,6 +2674,4 @@
   }
 
-  // analysis of the cycles (print rings, get minimum cycle length)
-  CyclicStructureAnalysis(out, BackEdgeStack, MinimumRingSize);
 
   *out << Verbose(1) << "Final graph info for each atom is:" << endl;
@@ -2709,5 +2711,5 @@
  * as cyclic and print out the cycles. 
  * \param *out output stream for debugging
- * \param *BackEdgeStack stack with all back edges found during DFS scan
+ * \param *BackEdgeStack stack with all back edges found during DFS scan. Beware: This stack contains the bonds from the total molecule, not from the subgraph!
  * \param *&MinimumRingSize contains smallest ring size in molecular structure on return or -1 if no rings were found, if set is maximum search distance
  * \todo BFS from the not-same-LP to find back to starting point of tributary cycle over more than one bond
@@ -2730,8 +2732,4 @@
     ColorList[i] = white;
   }
-  MinimumRingSize = new int[AtomCount];
-  for(int i=AtomCount;i--;)
-    MinimumRingSize[i] = AtomCount;
-
   
   *out << Verbose(1) << "Back edge list - ";
@@ -3535,5 +3533,5 @@
 	MoleculeListClass *BondFragments = NULL;
   int *SortIndex = NULL;
-  int *MinimumRingSize = NULL;
+  int *MinimumRingSize = new int[AtomCount];
   int FragmentCounter;
   MoleculeLeafClass *MolecularWalker = NULL;
@@ -3541,4 +3539,5 @@
   fstream File;
   bool FragmentationToDo = true;
+  class StackClass<bond *> *BackEdgeStack = NULL, *LocalBackEdgeStack = NULL;
   bool CheckOrder = false;
   Graph **FragmentList = NULL;
@@ -3572,8 +3571,28 @@
 
   // ===== 2. perform a DFS analysis to gather info on cyclic structure and a list of disconnected subgraphs =====
-  Subgraphs = DepthFirstSearchAnalysis(out, MinimumRingSize);
+  Subgraphs = DepthFirstSearchAnalysis(out, BackEdgeStack);
   // fill the bond structure of the individually stored subgraphs
   Subgraphs->next->FillBondStructureFromReference(out, this, (FragmentCounter = 0), ListOfLocalAtoms, false);  // we want to keep the created ListOfLocalAtoms
-
+  // analysis of the cycles (print rings, get minimum cycle length) for each subgraph
+  for(int i=AtomCount;i--;)
+    MinimumRingSize[i] = AtomCount;
+  MolecularWalker = Subgraphs;
+  FragmentCounter = 0;
+  while (MolecularWalker->next != NULL) {
+    MolecularWalker = MolecularWalker->next;
+    *out << Verbose(0) << "Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl;
+    LocalBackEdgeStack = new StackClass<bond *> (MolecularWalker->Leaf->BondCount);
+//    // check the list of local atoms for debugging
+//    *out << Verbose(0) << "ListOfLocalAtoms for this subgraph is:" << endl;
+//    for (int i=0;i<AtomCount;i++)
+//      if (ListOfLocalAtoms[FragmentCounter][i] == NULL)
+//        *out << "\tNULL";
+//      else
+//        *out << "\t" << ListOfLocalAtoms[FragmentCounter][i]->Name;
+    MolecularWalker->Leaf->PickLocalBackEdges(out, ListOfLocalAtoms[FragmentCounter++], BackEdgeStack, LocalBackEdgeStack);
+    MolecularWalker->Leaf->CyclicStructureAnalysis(out, LocalBackEdgeStack, MinimumRingSize);
+    delete(LocalBackEdgeStack);
+  }
+  
   // ===== 3. if structure still valid, parse key set file and others =====
   FragmentationToDo = FragmentationToDo && ParseKeySetFile(out, configuration->configpath, ParsedFragmentList);
@@ -3584,5 +3603,5 @@
   // =================================== Begin of FRAGMENTATION =============================== 
   // ===== 6a. assign each keyset to its respective subgraph ===== 
-  Subgraphs->next->AssignKeySetsToFragment(out, this, ParsedFragmentList, ListOfLocalAtoms, FragmentList, (FragmentCounter = 0), false);
+  Subgraphs->next->AssignKeySetsToFragment(out, this, ParsedFragmentList, ListOfLocalAtoms, FragmentList, (FragmentCounter = 0), true);
 
   // ===== 6b. prepare and go into the adaptive (Order<0), single-step (Order==0) or incremental (Order>0) cycle
@@ -3621,8 +3640,4 @@
   delete[](MinimumRingSize);
   
-  // free the index lookup list
-  for (int i=FragmentCounter;i--;)
-    Free((void **)&ListOfLocalAtoms[i], "molecule::FragmentMolecule - *ListOfLocalAtoms[]");
-  Free((void **)&ListOfLocalAtoms, "molecule::FragmentMolecule - **ListOfLocalAtoms");
 
   // ==================================== End of FRAGMENTATION ============================================
@@ -3698,4 +3713,42 @@
 };
 
+
+/** Picks from a global stack with all back edges the ones in the fragment.
+ * \param *out output stream for debugging
+ * \param **ListOfLocalAtoms array of father atom::nr to local atom::nr (reverse of atom::father)
+ * \param *ReferenceStack stack with all the back egdes
+ * \param *LocalStack stack to be filled
+ * \return true - everything ok, false - ReferenceStack was empty
+ */
+bool molecule::PickLocalBackEdges(ofstream *out, atom **ListOfLocalAtoms, class StackClass<bond *> *&ReferenceStack, class StackClass<bond *> *&LocalStack)
+{
+  bool status = true;
+  if (ReferenceStack->IsEmpty()) {
+    cerr << "ReferenceStack is empty!" << endl;
+    return false;
+  }
+  bond *Binder = ReferenceStack->PopFirst();
+  bond *FirstBond = Binder;   // mark the first bond, so that we don't loop through the stack indefinitely
+  atom *Walker = NULL, *OtherAtom = NULL;
+  ReferenceStack->Push(Binder);
+  
+  do {  // go through all bonds and push local ones
+    Walker = ListOfLocalAtoms[Binder->leftatom->nr];  // get one atom in the reference molecule
+    if (Walker == NULL) // if this Walker exists in the subgraph ... 
+      continue;
+    for(int i=0;i<NumberOfBondsPerAtom[Walker->nr];i++) {    // go through the local list of bonds
+      OtherAtom = ListOfBondsPerAtom[Walker->nr][i]->GetOtherAtom(Walker);
+      if (OtherAtom == ListOfLocalAtoms[Binder->rightatom->nr]) { // found the bond
+        LocalStack->Push(ListOfBondsPerAtom[Walker->nr][i]);
+        break;
+      }
+    }
+    Binder = ReferenceStack->PopFirst();  // loop the stack for next item
+    ReferenceStack->Push(Binder);
+  } while (FirstBond != Binder);
+  
+  return status;
+};
+
 /** Stores pairs (Atom::nr, Atom::AdaptiveOrder) into file.
  * Atoms not present in the file get "-1".
@@ -3840,5 +3893,5 @@
   while (Walker->next != end) {
     Walker = Walker->next; 
-    *out << Verbose(4) << "Atom " << Walker->Name << " with " << NumberOfBondsPerAtom[Walker->nr] << " bonds: ";
+    *out << Verbose(4) << "Atom " << Walker->Name << "/" << Walker->nr << " with " << NumberOfBondsPerAtom[Walker->nr] << " bonds: ";
     TotalDegree = 0;
     for (int j=0;j<NumberOfBondsPerAtom[Walker->nr];j++) {
Index: src/molecules.hpp
===================================================================
--- src/molecules.hpp	(revision ba4432331924fc02b7f5a1f24643fb79bc770fb4)
+++ src/molecules.hpp	(revision df793af37622fc6e5428ad9e5627590d46749e75)
@@ -284,6 +284,7 @@
   
   // Graph analysis
-  MoleculeLeafClass * DepthFirstSearchAnalysis(ofstream *out, int *&MinimumRingSize);
+  MoleculeLeafClass * DepthFirstSearchAnalysis(ofstream *out, class StackClass<bond *> *&BackEdgeStack);
   void CyclicStructureAnalysis(ofstream *out, class StackClass<bond *> *BackEdgeStack, int *&MinimumRingSize);
+  bool PickLocalBackEdges(ofstream *out, atom **ListOfLocalAtoms, class StackClass<bond *> *&ReferenceStack, class StackClass<bond *> *&LocalStack);
   bond * FindNextUnused(atom *vertex);
   void SetNextComponentNumber(atom *vertex, int nr);
@@ -378,5 +379,5 @@
   bool FillRootStackForSubgraphs(ofstream *out, KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter);
   bool AssignKeySetsToFragment(ofstream *out, molecule *reference, Graph *KeySetList, atom ***&ListOfLocalAtoms, Graph **&FragmentList, int &FragmentCounter, bool FreeList = false);
-  bool FillListOfLocalAtoms(ofstream *out, atom ***&ListOfLocalAtoms, int &FragmentCounter, int GlobalAtomCount, bool &FreeList);
+  bool FillListOfLocalAtoms(ofstream *out, atom ***&ListOfLocalAtoms, const int FragmentCounter, const int GlobalAtomCount, bool &FreeList);
   void TranslateIndicesToGlobalIDs(ofstream *out, Graph **FragmentList, int &FragmentCounter, int &TotalNumberOfKeySets, Graph &TotalGraph);
   int Count() const;
