Index: src/Actions/FragmentationAction/FragmentationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAction.cpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
+++ src/Actions/FragmentationAction/FragmentationAction.cpp	(revision 8387e06f968d381b3fce254b7726ba0d11c5a748)
@@ -47,4 +47,5 @@
 #include "World.hpp"
 
+#include <boost/filesystem.hpp>
 #include <iostream>
 #include <map>
@@ -80,8 +81,11 @@
   // go through all atoms, note down their molecules and group them
   typedef std::multimap<molecule *, atom *> clusters_t;
+  typedef std::vector<atomId_t> atomids_t;
+  atomids_t atomids;
   clusters_t clusters;
   for (World::AtomSelectionConstIterator iter = world.beginAtomSelection();
       iter != world.endAtomSelection(); ++iter) {
     clusters.insert( std::make_pair(iter->second->getMolecule(), iter->second) );
+    atomids.push_back(iter->second->getId());
   }
   LOG(1, "INFO: There are " << clusters.size()  << " molecules to consider.");
@@ -91,9 +95,15 @@
 
   // parse in Adjacency file
-  std::ifstream File;
-  std::string filename;
-  filename = params.prefix.get() + ADJACENCYFILE;
-  File.open(filename.c_str(), ios::out);
-  AdjacencyList FileChecker(File);
+  boost::shared_ptr<AdjacencyList> FileChecker;
+  boost::filesystem::path filename(params.prefix.get() + std::string(ADJACENCYFILE));
+  if (boost::filesystem::exists(filename) && boost::filesystem::is_regular_file(filename)) {
+    std::ifstream File;
+    File.open(filename.string().c_str(), ios::out);
+    FileChecker.reset(new AdjacencyList(File));
+    File.close();
+  } else {
+    LOG(1, "INFO: Could not open default adjacency file " << filename.string() << ".");
+    FileChecker.reset(new AdjacencyList);
+  }
 
   DepthFirstSearchAnalysis DFS;
@@ -119,5 +129,5 @@
         << " atoms, out of " << mol->getAtomCount() << ".");
     const enum HydrogenSaturation saturation =  params.DoSaturation.get() ? DoSaturate : DontSaturate;
-    Fragmentation Fragmenter(mol, FileChecker, saturation);
+    Fragmentation Fragmenter(mol, *FileChecker, saturation);
 
     // perform fragmentation
@@ -134,13 +144,26 @@
   }
   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();
+  {
+    ExportGraph_ToFiles exporter(TotalGraph, saturation);
+    exporter.setPrefix(params.prefix.get());
+    exporter.setOutputTypes(params.types.get());
+    exporter();
+  }
+
+  // store Adjacency to file
+  {
+    std::string filename = params.prefix.get() + ADJACENCYFILE;
+    std::ofstream AdjacencyFile;
+    AdjacencyFile.open(filename.c_str(), ios::out);
+    AdjacencyList adjacency(atomids);
+    adjacency.StoreToFile(AdjacencyFile);
+    AdjacencyFile.close();
+  }
+
   World::getInstance().setExitFlag(ExitFlag);
   end = clock();
   LOG(0, "STATUS: Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s.");
-
 
   return Action::success;
Index: src/Actions/MoleculeAction/SaveAdjacencyAction.cpp
===================================================================
--- src/Actions/MoleculeAction/SaveAdjacencyAction.cpp	(revision 0fad93db3291c128f999fcbf427d65f1824b785b)
+++ src/Actions/MoleculeAction/SaveAdjacencyAction.cpp	(revision 8387e06f968d381b3fce254b7726ba0d11c5a748)
@@ -40,5 +40,5 @@
 
 #include "CodePatterns/Log.hpp"
-#include "Graph/BondGraph.hpp"
+#include "Graph/AdjacencyList.hpp"
 #include "molecule.hpp"
 #include "World.hpp"
@@ -55,10 +55,22 @@
   molecule *mol = NULL;
 
+  // gather all desired ids
+  typedef std::vector<atomId_t> atomids_t;
+  atomids_t atomids;
   for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) {
     mol = iter->second;
-    LOG(0, "Storing adjacency to path " << params.adjacencyfile.get() << ".");
-    // TODO: sollte stream nicht filename benutzen, besser fuer unit test
-    mol->StoreAdjacencyToFile(params.adjacencyfile.get().leaf().string(), params.adjacencyfile.get().branch_path().string());
+    const molecule::atomIdSet &mol_atomids = mol->getAtomIds();
+    atomids.insert(atomids.end(), mol_atomids.begin(), mol_atomids.end());
   }
+
+  // store to file
+  AdjacencyList adjacency(atomids);
+  std::ofstream AdjacencyFile;
+  const std::string filename = params.adjacencyfile.get().string();
+  LOG(0, "STATUS: Storing adjacency of selected molecules to " << filename << ".");
+  AdjacencyFile.open(filename.c_str(), ios::out);
+  adjacency.StoreToFile(AdjacencyFile);
+  AdjacencyFile.close();
+
   return Action::success;
 }
