Index: src/Dynamics/LinearInterpolationBetweenSteps.hpp
===================================================================
--- src/Dynamics/LinearInterpolationBetweenSteps.hpp	(revision ed9da42cb5c88968f446c0eb8417821e6c6a5c71)
+++ src/Dynamics/LinearInterpolationBetweenSteps.hpp	(revision d4d7a1bd17bebcb9a0627ca68125673382918cbe)
@@ -93,10 +93,9 @@
 
 //    // store the list to single step files
-//    int *SortIndex = new int[atoms.size()];
+//    std::map<atomId_t, int> SortIndex;
 //    for (int i=atoms.size(); i--; )
 //      SortIndex[i] = i;
 //
 //    status = MoleculePerStep->OutputConfigForListOfFragments(prefix, SortIndex);
-//    delete[](SortIndex);
   };
 
Index: src/Fragmentation/Fragmentation.cpp
===================================================================
--- src/Fragmentation/Fragmentation.cpp	(revision ed9da42cb5c88968f446c0eb8417821e6c6a5c71)
+++ src/Fragmentation/Fragmentation.cpp	(revision d4d7a1bd17bebcb9a0627ca68125673382918cbe)
@@ -236,5 +236,5 @@
   if (BondFragments->ListOfMolecules.size() != 0) {
     // create the SortIndex from BFS labels to order in the config file
-    int *SortIndex = NULL;
+    std::map<atomId_t, int> SortIndex;
     CreateMappingLabelsToConfigSequence(SortIndex);
 
@@ -276,8 +276,4 @@
     // restore orbital and Stop values
     //CalculateOrbitals(*configuration);
-
-    // free memory for bond part
-    LOG(1, "Freeing bond memory");
-    delete[](SortIndex);
   } else {
     LOG(1, "FragmentList is zero on return, splitting failed.");
@@ -623,22 +619,23 @@
 
 /** Create a SortIndex to map from atomic labels to the sequence in which the atoms are given in the config file.
- * \param *out output stream for debugging
- * \param *&SortIndex Mapping array of size molecule::AtomCount
+ * \param &SortIndex Mapping array of size molecule::AtomCount
  * \return true - success, false - failure of SortIndex alloc
  */
-bool Fragmentation::CreateMappingLabelsToConfigSequence(int *&SortIndex)
-{
-  if (SortIndex != NULL) {
-    LOG(1, "SortIndex is " << SortIndex << " and not NULL as expected.");
+bool Fragmentation::CreateMappingLabelsToConfigSequence(std::map<atomId_t, int> &SortIndex)
+{
+  if (!SortIndex.empty()) {
+    LOG(1, "SortIndex has " << SortIndex.size() << " entries and is not empty as expected.");
     return false;
   }
-  SortIndex = new int[mol->getAtomCount()+1];
-  for(int i=mol->getAtomCount()+1;i--;)
-    SortIndex[i] = -1;
 
   int AtomNo = 0;
   for(molecule::const_iterator iter=mol->begin();iter!=mol->end();++iter){
-    ASSERT(SortIndex[(*iter)->getNr()]==-1,"Same SortIndex set twice");
-    SortIndex[(*iter)->getNr()] = AtomNo++;
+    const int id = (*iter)->getNr();
+#ifndef NDEBUG
+    std::pair<std::map<atomId_t, int>::const_iterator, bool> inserter =
+#endif
+    SortIndex.insert( std::make_pair(id, AtomNo++) );
+    ASSERT( inserter.second ,
+        "Fragmentation::CreateMappingLabelsToConfigSequence() - same SortIndex set twice.");
   }
 
Index: src/Fragmentation/Fragmentation.hpp
===================================================================
--- src/Fragmentation/Fragmentation.hpp	(revision ed9da42cb5c88968f446c0eb8417821e6c6a5c71)
+++ src/Fragmentation/Fragmentation.hpp	(revision d4d7a1bd17bebcb9a0627ca68125673382918cbe)
@@ -14,11 +14,11 @@
 #endif
 
-#include <string>
-
 #include "Graph/DepthFirstSearchAnalysis.hpp"
 
 #include "Fragmentation/HydrogenSaturation_enum.hpp"
 #include "Fragmentation/fragmentation_helpers.hpp"
+#include "types.hpp"
 
+#include <map>
 #include <string>
 #include <vector>
@@ -45,5 +45,5 @@
   int GuesstimateFragmentCount(int order);
 
-  bool CreateMappingLabelsToConfigSequence(int *&SortIndex);
+  bool CreateMappingLabelsToConfigSequence(std::map<atomId_t, int> &SortIndex);
 
   // order at site
Index: src/MoleculeListClass.hpp
===================================================================
--- src/MoleculeListClass.hpp	(revision ed9da42cb5c88968f446c0eb8417821e6c6a5c71)
+++ src/MoleculeListClass.hpp	(revision d4d7a1bd17bebcb9a0627ca68125673382918cbe)
@@ -15,4 +15,5 @@
 #include <iosfwd>
 #include <list>
+#include <map>
 #include <string>
 
@@ -22,4 +23,5 @@
 
 #include "Parser/ParserTypes.hpp"
+#include "types.hpp"
 
 class molecule;
@@ -43,9 +45,9 @@
 
   bool AddHydrogenCorrection(std::string &path);
-  bool StoreForcesFile(std::string &path, int *SortIndex);
+  bool StoreForcesFile(std::string &path, const std::map<atomId_t, int> &SortIndex);
   void insert(molecule *mol);
   void erase(molecule *mol);
   molecule * ReturnIndex(int index);
-  bool OutputConfigForListOfFragments(std::string &prefix, int *SortIndex, ParserTypes type);
+  bool OutputConfigForListOfFragments(std::string &prefix, const std::map<atomId_t, int> &SortIndex, ParserTypes type);
   int NumberOfActiveMolecules();
   void Enumerate(std::ostream *out);
Index: src/moleculelist.cpp
===================================================================
--- src/moleculelist.cpp	(revision ed9da42cb5c88968f446c0eb8417821e6c6a5c71)
+++ src/moleculelist.cpp	(revision d4d7a1bd17bebcb9a0627ca68125673382918cbe)
@@ -489,8 +489,8 @@
 /** Store force indices, i.e. the connection between the nuclear index in the total molecule config and the respective atom in fragment config.
  * \param &path path to file
- * \param *SortIndex Index to map from the BFS labeling to the sequence how of Ion_Type in the config
+ * \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 MoleculeListClass::StoreForcesFile(std::string &path, int *SortIndex)
+bool MoleculeListClass::StoreForcesFile(std::string &path, const std::map<atomId_t, int> &SortIndex)
 {
   bool status = true;
@@ -511,5 +511,10 @@
             if ((*atomIter)->getType()->getAtomicNumber() == (*elemIter).first) {
               if (((*atomIter)->GetTrueFather() != NULL) && ((*atomIter)->GetTrueFather() != (*atomIter))) {// if there is a rea
-                ForcesFile << SortIndex[(*atomIter)->GetTrueFather()->getNr()] << "\t";
+                const atomId_t fatherid = (*atomIter)->GetTrueFather()->getNr();
+                const std::map<atomId_t, int>::const_iterator iter = SortIndex.find(fatherid);
+                if( iter != SortIndex.end())
+                  ForcesFile << iter->second << "\t";
+                else
+                  ForcesFile << "-1\t";
               } else
                 // otherwise a -1 to indicate an added saturation hydrogen
@@ -535,9 +540,9 @@
  * \param *out output stream for debugging
  * \param &prefix path and prefix to the fragment config files
- * \param *SortIndex Index to map from the BFS labeling to the sequence how of Ion_Type in the config
+ * \param SortIndex Index to map from the BFS labeling to the sequence how of Ion_Type in the config
  * \param type desired type to store
  * \return true - success (each file was written), false - something went wrong.
  */
-bool MoleculeListClass::OutputConfigForListOfFragments(std::string &prefix, int *SortIndex, ParserTypes type)
+bool MoleculeListClass::OutputConfigForListOfFragments(std::string &prefix, const std::map<atomId_t, int> &SortIndex, ParserTypes type)
 {
   ofstream outputFragment;
