Index: src/Actions/FragmentationAction/FragmentationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAction.cpp	(revision dcbb5dac817f661e01dae1a9436a1ec9bb379493)
+++ src/Actions/FragmentationAction/FragmentationAction.cpp	(revision b4f72c33d00d959ec3b194e7ef824ee9baf108a4)
@@ -39,4 +39,5 @@
 #include "Fragmentation/Exporters/ExportGraph_ToFiles.hpp"
 #include "Fragmentation/Fragmentation.hpp"
+#include "Fragmentation/Graph.hpp"
 #include "Fragmentation/HydrogenSaturation_enum.hpp"
 #include "Graph/CheckAgainstAdjacencyFile.hpp"
@@ -86,4 +87,7 @@
   LOG(1, "INFO: There are " << clusters.size()  << " molecules to consider.");
 
+  // get whether to saturate or not
+  const enum HydrogenSaturation saturation =  params.DoSaturation.get() ? DoSaturate : DontSaturate;
+
   // parse in Adjacency file
   std::ifstream File;
@@ -97,4 +101,6 @@
   // go through all keys (i.e. all molecules)
   clusters_t::const_iterator advanceiter;
+  Graph TotalGraph;
+  int keysetcounter = 0;
   for (clusters_t::const_iterator iter = clusters.begin();
       iter != clusters.end();
@@ -124,11 +130,13 @@
         ExitFlag = tempFlag; // if we are the first, we set the standard
     }
+    TotalGraph.InsertGraph(Fragmenter.getGraph(), keysetcounter);
 
-    // store molecule's fragment to file
-    ExportGraph_ToFiles exporter(Fragmenter.getGraph(), mol, saturation);
-    exporter.setPrefix(params.prefix.get());
-    exporter.setOutputTypes(params.types.get());
-    exporter();
   }
+  LOG(0, "STATUS: There are " << keysetcounter << " fragments.");
+  // store molecule's fragment to file
+  ExportGraph_ToFiles exporter(TotalGraph, saturation);
+  exporter.setPrefix(params.prefix.get());
+  exporter.setOutputTypes(params.types.get());
+  exporter();
   World::getInstance().setExitFlag(ExitFlag);
   end = clock();
Index: src/Fragmentation/Exporters/ExportGraph_ToFiles.cpp
===================================================================
--- src/Fragmentation/Exporters/ExportGraph_ToFiles.cpp	(revision dcbb5dac817f661e01dae1a9436a1ec9bb379493)
+++ src/Fragmentation/Exporters/ExportGraph_ToFiles.cpp	(revision b4f72c33d00d959ec3b194e7ef824ee9baf108a4)
@@ -54,9 +54,8 @@
  *
  * @param _graph instance of Graph containing keyset of each fragment
- * @param _mol molecule as reference
- */
-ExportGraph_ToFiles::ExportGraph_ToFiles(const Graph &_graph, molecule *&_mol, const enum HydrogenSaturation _saturation) :
+ * @param saturation whether to saturate dangling bonds with hydrogen or not
+ */
+ExportGraph_ToFiles::ExportGraph_ToFiles(const Graph &_graph, const enum HydrogenSaturation _saturation) :
 		ExportGraph(_graph),
-		mol(_mol),
 		BondFragments(World::getPointer()),
 		saturation(_saturation)
@@ -107,5 +106,5 @@
   // store force index reference file
   {
-    SortIndex_t SortIndex(mol);
+    SortIndex_t SortIndex;
     BondFragments.StoreForcesFile(prefix, SortIndex);
   }
@@ -113,10 +112,4 @@
   // store keysets file
   TotalGraph.StoreKeySetFile(prefix);
-
-  {
-    // store Adjacency file
-    std::string filename = prefix + ADJACENCYFILE;
-    mol->StoreAdjacencyToFile(filename);
-  }
 
   // store Hydrogen saturation correction file
@@ -137,5 +130,5 @@
     LOG(2, "DEBUG: Fragment No." << (*runner).second.first << " with TEFactor "
     		<< (*runner).second.second << ".");
-    BondFragments.insert(StoreFragmentFromKeySet(mol, test, World::getInstance().getConfig()));
+    BondFragments.insert(StoreFragmentFromKeySet(test, World::getInstance().getConfig()));
     ++count;
   }
@@ -147,10 +140,9 @@
  * First creates the minimal set of atoms from the KeySet, then creates the bond structure from the complete
  * molecule and adds missing hydrogen where bonds were cut.
- * \param *mol reference molecule
  * \param &Leaflet pointer to KeySet structure
  * \param IsAngstroem whether we have Ansgtroem or bohrradius
  * \return pointer to constructed molecule
  */
-molecule * ExportGraph_ToFiles::StoreFragmentFromKeySet(molecule *mol, KeySet &Leaflet, bool IsAngstroem)
+molecule * ExportGraph_ToFiles::StoreFragmentFromKeySet(KeySet &Leaflet, bool IsAngstroem)
 {
   Info info(__func__);
@@ -158,8 +150,8 @@
   molecule *Leaf = World::getInstance().createMolecule();
 
-  StoreFragmentFromKeySet_Init(mol, Leaf, Leaflet, SonList);
+  StoreFragmentFromKeySet_Init(Leaf, Leaflet, SonList);
   // create the bonds between all: Make it an induced subgraph and add hydrogen
 //  LOG(2, "Creating bonds from father graph (i.e. induced subgraph creation).");
-  CreateInducedSubgraphOfFragment(mol, Leaf, SonList, IsAngstroem);
+  CreateInducedSubgraphOfFragment(Leaf, SonList, IsAngstroem);
 
   //Leaflet->Leaf->ScanForPeriodicCorrection(out);
@@ -168,5 +160,4 @@
 
 /** Initializes some value for putting fragment of \a *mol into \a *Leaf.
- * \param *mol total molecule
  * \param *Leaf fragment molecule
  * \param &Leaflet pointer to KeySet structure
@@ -174,12 +165,13 @@
  * \return number of atoms in fragment
  */
-int ExportGraph_ToFiles::StoreFragmentFromKeySet_Init(molecule *mol, molecule *Leaf, KeySet &Leaflet, ListOfLocalAtoms_t &SonList)
+int ExportGraph_ToFiles::StoreFragmentFromKeySet_Init(molecule *Leaf, KeySet &Leaflet, ListOfLocalAtoms_t &SonList)
 {
   atom *FatherOfRunner = NULL;
 
   // first create the minimal set of atoms from the KeySet
+  World &world = World::getInstance();
   int size = 0;
   for(KeySet::const_iterator runner = Leaflet.begin(); runner != Leaflet.end(); runner++) {
-    FatherOfRunner = mol->FindAtom((*runner));  // find the id
+    FatherOfRunner = world.getAtom(AtomById(*runner));  // find the id
     SonList.insert( std::make_pair(FatherOfRunner->getNr(), Leaf->AddCopyAtom(FatherOfRunner) ) );
     size++;
@@ -189,11 +181,9 @@
 
 /** Creates an induced subgraph out of a fragmental key set, adding bonds and hydrogens (if treated specially).
- * \param *out output stream for debugging messages
- * \param *mol total molecule
  * \param *Leaf fragment molecule
  * \param IsAngstroem whether we have Ansgtroem or bohrradius
- * \param SonList list which atom of \a *Leaf is a son of which atom in \a *mol
- */
-void ExportGraph_ToFiles::CreateInducedSubgraphOfFragment(molecule *mol, molecule *Leaf, ListOfLocalAtoms_t &SonList, bool IsAngstroem)
+ * \param SonList list which atom of \a *Leaf is another atom's son
+ */
+void ExportGraph_ToFiles::CreateInducedSubgraphOfFragment(molecule *Leaf, ListOfLocalAtoms_t &SonList, bool IsAngstroem)
 {
   bool LonelyFlag = false;
Index: src/Fragmentation/Exporters/ExportGraph_ToFiles.hpp
===================================================================
--- src/Fragmentation/Exporters/ExportGraph_ToFiles.hpp	(revision dcbb5dac817f661e01dae1a9436a1ec9bb379493)
+++ src/Fragmentation/Exporters/ExportGraph_ToFiles.hpp	(revision b4f72c33d00d959ec3b194e7ef824ee9baf108a4)
@@ -22,4 +22,5 @@
 
 class ListOfLocalAtoms_t;
+class molecule;
 
 /** ExportGraph_ToFiles implements an ExportGraph as storing all fragmentary
@@ -29,5 +30,5 @@
 {
 public:
-	ExportGraph_ToFiles(const Graph &_graph, molecule *&_mol, const enum HydrogenSaturation _saturation);
+	ExportGraph_ToFiles(const Graph &_graph, const enum HydrogenSaturation _saturation);
 	virtual ~ExportGraph_ToFiles();
 
@@ -45,11 +46,9 @@
 
 	void prepareMolecule();
-  molecule * StoreFragmentFromKeySet(molecule *mol, KeySet &Leaflet, bool IsAngstroem);
-  int StoreFragmentFromKeySet_Init(molecule *mol, molecule *Leaf, KeySet &Leaflet, ListOfLocalAtoms_t &SonList);
-  void CreateInducedSubgraphOfFragment(molecule *mol, molecule *Leaf, ListOfLocalAtoms_t &SonList, bool IsAngstroem);
+  molecule * StoreFragmentFromKeySet(KeySet &Leaflet, bool IsAngstroem);
+  int StoreFragmentFromKeySet_Init(molecule *Leaf, KeySet &Leaflet, ListOfLocalAtoms_t &SonList);
+  void CreateInducedSubgraphOfFragment(molecule *Leaf, ListOfLocalAtoms_t &SonList, bool IsAngstroem);
 
 private:
-  //!> molecule as reference
-  molecule *mol;
   //!> internal list of created molecules
 	MoleculeListClass BondFragments;
Index: src/Fragmentation/Fragmentation.cpp
===================================================================
--- src/Fragmentation/Fragmentation.cpp	(revision dcbb5dac817f661e01dae1a9436a1ec9bb379493)
+++ src/Fragmentation/Fragmentation.cpp	(revision b4f72c33d00d959ec3b194e7ef824ee9baf108a4)
@@ -163,4 +163,10 @@
   LOG(1, "STATUS: We have created " << TotalGraph.size() << " fragments.");
 
+  {
+    // store Adjacency file
+    std::string filename = prefix + ADJACENCYFILE;
+    mol->StoreAdjacencyToFile(filename);
+  }
+
   // store adaptive orders into file
   StoreOrderAtSiteFile(prefix);
Index: src/Fragmentation/Graph.cpp
===================================================================
--- src/Fragmentation/Graph.cpp	(revision dcbb5dac817f661e01dae1a9436a1ec9bb379493)
+++ src/Fragmentation/Graph.cpp	(revision b4f72c33d00d959ec3b194e7ef824ee9baf108a4)
@@ -64,14 +64,14 @@
  * \param *counter keyset counter that gets increased
  */
-void Graph::InsertGraph(Graph &graph, int *counter)
+void Graph::InsertGraph(const Graph &graph, int &counter)
 {
   GraphTestPair testGraphInsert;
 
-  for(Graph::iterator runner = graph.begin(); runner != graph.end(); runner++) {
-    testGraphInsert = insert(GraphPair ((*runner).first,pair<int,double>((*counter)++,((*runner).second).second)));  // store fragment number and current factor
+  for(Graph::const_iterator runner = graph.begin(); runner != graph.end(); runner++) {
+    testGraphInsert = insert(GraphPair ((*runner).first,pair<int,double>(++counter,((*runner).second).second)));  // store fragment number and current factor
     if (testGraphInsert.second) {
-      LOG(2, "INFO: KeySet " << (*counter)-1 << " successfully inserted.");
+      LOG(2, "INFO: KeySet " << counter-1 << " successfully inserted.");
     } else {
-      LOG(2, "INFO: KeySet " << (*counter)-1 << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first);
+      LOG(2, "INFO: KeySet " << counter-1 << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first);
       ((*(testGraphInsert.first)).second).second += (*runner).second.second;
       LOG(2, "INFO: New factor is " << (*(testGraphInsert.first)).second.second << ".");
Index: src/Fragmentation/Graph.hpp
===================================================================
--- src/Fragmentation/Graph.hpp	(revision dcbb5dac817f661e01dae1a9436a1ec9bb379493)
+++ src/Fragmentation/Graph.hpp	(revision b4f72c33d00d959ec3b194e7ef824ee9baf108a4)
@@ -30,5 +30,5 @@
   ~Graph();
 
-  void InsertGraph(Graph &graph, int *counter);
+  void InsertGraph(const Graph &graph, int &counter);
 
   bool ParseKeySetFile(std::string &path);
Index: src/Fragmentation/SortIndex.cpp
===================================================================
--- src/Fragmentation/SortIndex.cpp	(revision dcbb5dac817f661e01dae1a9436a1ec9bb379493)
+++ src/Fragmentation/SortIndex.cpp	(revision b4f72c33d00d959ec3b194e7ef824ee9baf108a4)
@@ -46,29 +46,7 @@
 {}
 
-/** Constructor for SortIndex from the internal numbering in a molecule.
- *
- * \param *mol molecule to place in the internal index
- */
-SortIndex_t::SortIndex_t(const molecule *mol)
-{
-  int AtomNo = 0;
-  for(molecule::const_iterator iter=mol->begin();iter!=mol->end();++iter){
-#ifndef NDEBUG
-    std::pair<index_t::iterator, bool> inserter =
-#endif
-        index.insert( std::make_pair((*iter)->getNr(), AtomNo) );
-    ASSERT( inserter.second,
-        "SortIndex_t::SortIndex_t() - index "+toString((*iter)->getNr())+" already present.");
-    ++AtomNo;
-  }
-}
-
 
 int SortIndex_t::find(atomId_t id) const
 {
-  index_t::const_iterator iter = index.find(id);
-  if (iter == index.end())
-    return -1;
-  else
-    return iter->second;
+  return id;
 }
Index: src/Fragmentation/SortIndex.hpp
===================================================================
--- src/Fragmentation/SortIndex.hpp	(revision dcbb5dac817f661e01dae1a9436a1ec9bb379493)
+++ src/Fragmentation/SortIndex.hpp	(revision b4f72c33d00d959ec3b194e7ef824ee9baf108a4)
@@ -28,5 +28,4 @@
 public:
   SortIndex_t();
-  SortIndex_t(const molecule *mol);
 
   int find(atomId_t id) const;
Index: src/Fragmentation/fragmentation_helpers.cpp
===================================================================
--- src/Fragmentation/fragmentation_helpers.cpp	(revision dcbb5dac817f661e01dae1a9436a1ec9bb379493)
+++ src/Fragmentation/fragmentation_helpers.cpp	(revision b4f72c33d00d959ec3b194e7ef824ee9baf108a4)
@@ -102,5 +102,5 @@
     for(int i=0;i<NumLevels;i++) {
       if (FragmentLowerOrdersList[RootNr][i] != NULL) {
-        FragmentList.InsertGraph((*FragmentLowerOrdersList[RootNr][i]), &counter);
+        FragmentList.InsertGraph((*FragmentLowerOrdersList[RootNr][i]), counter);
       }
     }
