Index: src/Fragmentation/Exporters/ExportGraph_ToFiles.cpp
===================================================================
--- src/Fragmentation/Exporters/ExportGraph_ToFiles.cpp	(revision c396753f3715e527d3df8060e6ac6d846655f950)
+++ src/Fragmentation/Exporters/ExportGraph_ToFiles.cpp	(revision 7cdf589ccf036e0f97d60e4706154d2a771a947b)
@@ -71,22 +71,71 @@
 {}
 
+/** Returns a string with \a i prefixed with 0s to match order of total number of molecules in digits.
+ * \param FragmentNumber total number of fragments to determine necessary number of digits
+ * \param digits number to create with 0 prefixed
+ * \return allocated(!) char array with number in digits, ten base.
+ */
+static char *FixedDigitNumber(const int FragmentNumber, const int digits)
+{
+  char *returnstring;
+  int number = FragmentNumber;
+  int order = 0;
+  while (number != 0) { // determine number of digits needed
+    number = (int)floor(((double)number / 10.));
+    order++;
+    //LOG(0, "Number is " << number << ", order is " << order << ".");
+  }
+  // allocate string
+  returnstring = new char[order + 2];
+  // terminate  and fill string array from end backward
+  returnstring[order] = '\0';
+  number = digits;
+  for (int i=order;i--;) {
+    returnstring[i] = '0' + (char)(number % 10);
+    number = (int)floor(((double)number / 10.));
+  }
+  //LOG(0, returnstring);
+  return returnstring;
+};
+
 /** Actual implementation of the export to files function.
  */
 void ExportGraph_ToFiles::operator()()
 {
-  ExportGraph::operator()();
+  LOG(1, "INFO: Writing " << TotalGraph.size() << " possible bond fragmentation configs");
+  size_t FragmentCounter = 0;
+  char *FragmentNumber = NULL;
+  string filename(prefix);
+  filename += FORCESFILE;
+  std::ofstream ForcesFile(filename.c_str());
+  SortIndex_t SortIndex;
 
   // ===== 9. Save fragments' configuration and keyset files et al to disk ===
-  LOG(1, "Writing " << BondFragments.ListOfMolecules.size() << " possible bond fragmentation configs");
   bool write_status = true;
-  for (std::vector<std::string>::const_iterator iter = typelist.begin();
-      iter != typelist.end();
-      ++iter) {
-    LOG(2, "INFO: Writing bond fragments for type " << (*iter) << ".");
+  ExportGraph::SaturatedFragment_ptr CurrentFragment = getNextFragment();
+  for (; (CurrentFragment != NULL) && (CurrentFragment->getKeySet() != ExportGraph::EmptySet);
+      CurrentFragment = getNextFragment()) {
+    const KeySet &set = CurrentFragment->getKeySet();
+    LOG(2, "INFO: Writing bond fragments for set " << set << ".");
+    // store config in stream
+    {
+      // open file
+      FragmentNumber = FixedDigitNumber(TotalGraph.size(), FragmentCounter++);
+      storeFragmentForAllTypes(
+          CurrentFragment, FragmentNumber, FragmentCounter-1);
+      delete[](FragmentNumber);
+    }
+    // store force index reference file
     write_status = write_status
-    && BondFragments.OutputConfigForListOfFragments(
-        prefix,
-        FormatParserStorage::getInstance().getTypeFromName(*iter));
-  }
+        && appendToForcesFile(CurrentFragment, ForcesFile, SortIndex);
+    // explicitly release fragment
+    CurrentFragment.reset();
+  }
+  if (CurrentFragment == NULL) {
+    ELOG(1, "Some error while obtaining the next fragment occured.");
+    return;
+  }
+  ForcesFile.close();
+
   if (write_status)
     LOG(1, "All configs written.");
@@ -94,15 +143,9 @@
     LOG(1, "Some config writing failed.");
 
-  // store force index reference file
-  {
-    SortIndex_t SortIndex;
-    BondFragments.StoreForcesFile(prefix, SortIndex);
-  }
-
   // store keysets file
   TotalGraph.StoreKeySetFile(prefix);
 
   // store Hydrogen saturation correction file
-  BondFragments.AddHydrogenCorrection(prefix);
+//  BondFragments.AddHydrogenCorrection(prefix);
 
   // restore orbital and Stop values
@@ -110,3 +153,91 @@
 }
 
-
+bool ExportGraph_ToFiles::storeFragmentForAllTypes(
+    SaturatedFragment_ptr &CurrentFragment,
+    char *FragmentNumber,
+    size_t FragmentCounter) const
+{
+  bool write_status = true;
+
+  // go through all desired types
+  for (std::vector<std::string>::const_iterator typeiter = typelist.begin();
+      typeiter != typelist.end(); ++typeiter) {
+    const std::string &typeName = *typeiter;
+    const ParserTypes type =
+        FormatParserStorage::getInstance().getTypeFromName(typeName);
+    // create filenname and open
+    const std::string FragmentName =
+        prefix + FragmentNumber + "." + FormatParserStorage::getInstance().getSuffixFromType(type);
+    std::ofstream outputFragment(FragmentName.c_str(), ios::out);
+
+    // write to this stream
+    {
+      std::stringstream output;
+      output << "INFO: Saving bond fragment No. " << FragmentNumber << "/"
+          << FragmentCounter << " as " << typeName << " ... ";
+      const bool intermediate_result = CurrentFragment->OutputConfig(outputFragment,type);
+      write_status &= intermediate_result;
+      if (intermediate_result)
+        output << " done.";
+      else
+        output << " failed.";
+      LOG(2, output.str());
+    }
+
+    // close file
+    outputFragment.close();
+    outputFragment.clear();
+  }
+
+  return write_status;
+}
+
+bool ExportGraph_ToFiles::appendToForcesFile(
+    SaturatedFragment_ptr &CurrentFragment,
+    std::ostream &ForcesFile,
+    const SortIndex_t &SortIndex) const
+{
+  bool status = true;
+//  periodentafel *periode=World::getInstance().getPeriode();
+
+  // open file for the force factors
+  if (ForcesFile.good()) {
+    //output << prefix << "Forces" << endl;
+    const KeySet &FullMolecule = CurrentFragment->getFullMolecule();
+    const KeySet &SaturationHydrogens = CurrentFragment->getSaturationHydrogens();
+    for (KeySet::const_iterator keyiter = FullMolecule.begin();
+        keyiter != FullMolecule.end();
+        ++keyiter) {
+      if (SaturationHydrogens.find(*keyiter) == SaturationHydrogens.end()) {
+        ForcesFile << SortIndex.find(*keyiter) << "\t";
+      } else {
+        // otherwise a -1 to indicate an added saturation hydrogen
+        ForcesFile << "-1\t";
+      }
+    }
+//    for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) {
+//      periodentafel::const_iterator elemIter;
+//      for(elemIter=periode->begin();elemIter!=periode->end();++elemIter){
+//        if ((*ListRunner)->hasElement((*elemIter).first)) { // if this element got atoms
+//          for(molecule::iterator atomIter = (*ListRunner)->begin(); atomIter !=(*ListRunner)->end();++atomIter){
+//            if ((*atomIter)->getType()->getAtomicNumber() == (*elemIter).first) {
+//              if (((*atomIter)->GetTrueFather() != NULL) && ((*atomIter)->GetTrueFather() != (*atomIter))) {// if there is a rea
+//                const atomId_t fatherid = (*atomIter)->GetTrueFather()->getId();
+//                ForcesFile << SortIndex.find(fatherid) << "\t";
+//              } else
+//                // otherwise a -1 to indicate an added saturation hydrogen
+//                ForcesFile << "-1\t";
+//            }
+//          }
+//        }
+//      }
+//      ForcesFile << endl;
+//    }
+    ForcesFile << std::endl;
+  } else {
+    status = false;
+    ELOG(1, "Failure on appending to ForcesFile.");
+  }
+
+  return status;
+}
Index: src/Fragmentation/Exporters/ExportGraph_ToFiles.hpp
===================================================================
--- src/Fragmentation/Exporters/ExportGraph_ToFiles.hpp	(revision c396753f3715e527d3df8060e6ac6d846655f950)
+++ src/Fragmentation/Exporters/ExportGraph_ToFiles.hpp	(revision 7cdf589ccf036e0f97d60e4706154d2a771a947b)
@@ -47,4 +47,30 @@
 
 private:
+	/** Helper function to store a fragment for all desired types to file.
+	 *
+	 * \param CurrentFragment SaturatedFragment to store to file
+	 * \param FragmentNumber number padded with zeros used in filename
+	 * \param FragmentCounter enumeration of this fragment
+	 * \return true - file written successfully, false - writing failed
+	 */
+	bool storeFragmentForAllTypes(
+	    SaturatedFragment_ptr &CurrentFragment,
+	    char *FragmentNumber,
+	    size_t FragmentCounter) const;
+
+	/** Helper function to append the key sets in this SaturatedFragment without
+	 * added hydrogens to an open stream.
+	 *
+	 * \param CurrentFragment fragment whose indices to write
+   * \param ForcesFile open stream to write to
+   * \param SortIndex Index to map from the BFS labeling to the sequence how of Ion_Type in the config
+   * \return true - file written successfully, false - writing failed
+   */
+	bool appendToForcesFile(
+	    SaturatedFragment_ptr &CurrentFragment,
+	    std::ostream &ForcesFile,
+	    const SortIndex_t &SortIndex) const;
+
+private:
 	//!> prefix for fragment files
 	std::string prefix;
