Index: src/Actions/FragmentationAction/FragmentationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAction.cpp	(revision d1ba0df07713d2a30843b694f8e7a087b45fd936)
+++ src/Actions/FragmentationAction/FragmentationAction.cpp	(revision bfbd4a376406cc93fa60892e691159cc09a8a35a)
@@ -107,5 +107,11 @@
   }
 
+  // we require the current bond graph
   DepthFirstSearchAnalysis DFS;
+
+  // we parse in the keysets from last time if present
+  Graph StoredGraph;
+  StoredGraph.ParseKeySetFile(params.prefix.get());
+
   start = clock();
   // go through all keys (i.e. all molecules)
@@ -134,5 +140,6 @@
     LOG(0, std::endl << " ========== Fragmentation of molecule " << mol->getName() << " ========================= ");
     {
-      const int tempFlag = Fragmenter.FragmentMolecule(mols_atomids, params.order.get(), params.prefix.get(), DFS);
+      Graph StoredLocalGraph(StoredGraph.getLocalGraph(mol));
+      const int tempFlag = Fragmenter.FragmentMolecule(mols_atomids, params.order.get(), params.prefix.get(), DFS, StoredLocalGraph);
       if ((ExitFlag == 2) && (tempFlag != 2))
         ExitFlag = tempFlag; // if there is one molecule that needs further fragmentation, it overrides others
@@ -144,4 +151,9 @@
   }
   LOG(0, "STATUS: There are " << keysetcounter << " fragments.");
+
+  // store keysets to file
+  {
+    TotalGraph.StoreKeySetFile(params.prefix.get());
+  }
 
   // store molecule's fragment to file
Index: src/Fragmentation/Fragmentation.cpp
===================================================================
--- src/Fragmentation/Fragmentation.cpp	(revision d1ba0df07713d2a30843b694f8e7a087b45fd936)
+++ src/Fragmentation/Fragmentation.cpp	(revision bfbd4a376406cc93fa60892e691159cc09a8a35a)
@@ -101,5 +101,6 @@
     int Order,
     const std::string &prefix,
-    DepthFirstSearchAnalysis &DFS)
+    DepthFirstSearchAnalysis &DFS,
+    const Graph &ParsedFragmentList)
 {
   std::fstream File;
@@ -139,8 +140,4 @@
       AtomMask.setFalse((*iter)->getNr());
   }
-
-  // ===== 3. if structure still valid, parse key set file and others =====
-  Graph ParsedFragmentList;
-  FragmentationToDo = FragmentationToDo && ParsedFragmentList.ParseKeySetFile(prefix);
 
   // ===== 4. check globally whether there's something to do actually (first adaptivity check)
@@ -491,5 +488,5 @@
  * \retuen true - success, false - failure
  */
-bool Fragmentation::AssignKeySetsToFragment(Graph &KeySetList, ListOfLocalAtoms_t &ListOfLocalAtoms, Graph &FragmentList, bool FreeList)
+bool Fragmentation::AssignKeySetsToFragment(const Graph &KeySetList, ListOfLocalAtoms_t &ListOfLocalAtoms, Graph &FragmentList, bool FreeList)
 {
   Info FunctionInfo(__func__);
@@ -506,5 +503,5 @@
     // assign scanned keysets
     KeySet TempSet;
-    for (Graph::iterator runner = KeySetList.begin(); runner != KeySetList.end(); runner++) { // key sets contain global numbers!
+    for (Graph::const_iterator runner = KeySetList.begin(); runner != KeySetList.end(); runner++) { // key sets contain global numbers!
       if (ListOfLocalAtoms[mol->FindAtom(*((*runner).first.begin()))->getNr()] != 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
Index: src/Fragmentation/Fragmentation.hpp
===================================================================
--- src/Fragmentation/Fragmentation.hpp	(revision d1ba0df07713d2a30843b694f8e7a087b45fd936)
+++ src/Fragmentation/Fragmentation.hpp	(revision bfbd4a376406cc93fa60892e691159cc09a8a35a)
@@ -37,5 +37,5 @@
   ~Fragmentation();
 
-  int FragmentMolecule(const std::vector<atomId_t> &atomids, int Order, const std::string &prefix, DepthFirstSearchAnalysis &DFS);
+  int FragmentMolecule(const std::vector<atomId_t> &atomids, int Order, const std::string &prefix, DepthFirstSearchAnalysis &DFS, const Graph &ParsedFragmentList);
 
   const Graph& getGraph() const {
@@ -55,5 +55,5 @@
   // storing fragments
   void FillRootStackForSubgraphs(KeyStack &RootStack, const AtomMask_t &AtomMask);
-  bool AssignKeySetsToFragment(Graph &KeySetList, ListOfLocalAtoms_t &ListOfLocalAtoms, Graph &FragmentList, bool FreeList = false);
+  bool AssignKeySetsToFragment(const Graph &KeySetList, ListOfLocalAtoms_t &ListOfLocalAtoms, Graph &FragmentList, bool FreeList = false);
   void TranslateIndicesToGlobalIDs(Graph &FragmentList, int &TotalNumberOfKeySets, Graph &TotalGraph);
 
Index: src/Fragmentation/Graph.cpp
===================================================================
--- src/Fragmentation/Graph.cpp	(revision d1ba0df07713d2a30843b694f8e7a087b45fd936)
+++ src/Fragmentation/Graph.cpp	(revision bfbd4a376406cc93fa60892e691159cc09a8a35a)
@@ -44,7 +44,10 @@
 #include "CodePatterns/Log.hpp"
 
+#include "Atom/atom.hpp"
+#include "Descriptors/AtomIdDescriptor.hpp"
 #include "Fragmentation/AdaptivityMap.hpp"
 #include "Helpers/defs.hpp"
 #include "Helpers/helpers.hpp"
+#include "World.hpp"
 
 /** Constructor for class Graph.
@@ -246,2 +249,40 @@
   return IndexKeySetList;
 };
+
+/** For a given molecule, returns each keyset local to this molecule.
+ *
+ * @param mol desired molecule
+ * @return graph with local keysets (local ids!)
+ */
+Graph Graph::getLocalGraph(const molecule* mol) const
+{
+  Graph LocalGraph;
+  // go through all key sets, assuming ids are global
+  for (const_iterator iter = begin(); iter != end(); ++iter) {
+    // check whether each keyset's GLOBAL id is contained in mol_ids (via conversion through World)
+    KeySet temp;
+    for (KeySet::const_iterator keyiter = iter->first.begin();
+        keyiter != iter->first.end(); ++keyiter) {
+      const size_t globalid = *keyiter;
+      const atom *Walker = World::getInstance().getAtom(AtomById(globalid));
+      if (Walker != NULL) {
+        if (Walker->getMolecule() != mol) {
+          break;
+        } else {
+          // and store the LOCAL number
+          const size_t localid = Walker->getNr();
+          temp.insert(localid);
+        }
+      } else {
+        ELOG(0, "Id " << globalid << " is not associated with any atom.");
+        break;
+      }
+    }
+    if (temp.size() == iter->first.size()) {
+      // if so, add to LocalGraph
+      LocalGraph.insert( std::make_pair(temp, iter->second) );
+    }
+  }
+
+  return LocalGraph;
+}
Index: src/Fragmentation/Graph.hpp
===================================================================
--- src/Fragmentation/Graph.hpp	(revision d1ba0df07713d2a30843b694f8e7a087b45fd936)
+++ src/Fragmentation/Graph.hpp	(revision bfbd4a376406cc93fa60892e691159cc09a8a35a)
@@ -23,4 +23,5 @@
 
 class AdaptivityMap;
+class molecule;
 
 class Graph : public std::map <KeySet, NumberValuePair >
@@ -37,4 +38,6 @@
   bool StoreTEFactorsFile(char *path) const;
 
+  Graph getLocalGraph(const molecule* mol) const;
+
   AdaptivityMap * GraphToAdaptivityMap() const;
 };
