Index: src/Graph/DepthFirstSearchAnalysis.cpp
===================================================================
--- src/Graph/DepthFirstSearchAnalysis.cpp	(revision 94d5ac60852caf3933c959f8314ca0be3d3a7c51)
+++ src/Graph/DepthFirstSearchAnalysis.cpp	(revision f968742be974e94db1c9b45ea28719c21790e2c1)
@@ -48,4 +48,5 @@
 #include "Descriptors/AtomDescriptor.hpp"
 #include "Descriptors/MoleculeDescriptor.hpp"
+#include "Graph/ListOfLocalAtoms.hpp"
 #include "molecule.hpp"
 #include "MoleculeLeafClass.hpp"
@@ -121,5 +122,5 @@
 
 
-bool DepthFirstSearchAnalysis::PickLocalBackEdges(atom **ListOfLocalAtoms, std::deque<bond *> *&LocalStack) const
+bool DepthFirstSearchAnalysis::PickLocalBackEdges(const ListOfLocalAtoms_t &ListOfLocalAtoms, std::deque<bond *> *&LocalStack) const
 {
   bool status = true;
@@ -133,5 +134,9 @@
 
   do { // go through all bonds and push local ones
-    Walker = ListOfLocalAtoms[Binder->leftatom->getNr()]; // get one atom in the reference molecule
+    const ListOfLocalAtoms_t::const_iterator leftiter = ListOfLocalAtoms.find(Binder->leftatom->getNr());
+    ASSERT( leftiter != ListOfLocalAtoms.end(),
+        "DepthFirstSearchAnalysis::PickLocalBackEdges() - could not find atom id "
+        +toString(Binder->leftatom->getNr())+" in ListOfLocalAtoms.");
+    Walker = leftiter->second; // get one atom in the reference molecule
     if (Walker != NULL) { // if this Walker exists in the subgraph ...
       const BondList& ListOfBonds = Walker->getListOfBonds();
@@ -140,5 +145,6 @@
           ++Runner) {
         OtherAtom = (*Runner)->GetOtherAtom(Walker);
-        if (OtherAtom == ListOfLocalAtoms[(*Runner)->rightatom->getNr()]) { // found the bond
+        const ListOfLocalAtoms_t::const_iterator rightiter = ListOfLocalAtoms.find((*Runner)->rightatom->getNr());
+        if (OtherAtom == rightiter->second) { // found the bond
           LocalStack->push_front((*Runner));
           LOG(3, "INFO: Found local edge " << *(*Runner) << ".");
Index: src/Graph/DepthFirstSearchAnalysis.hpp
===================================================================
--- src/Graph/DepthFirstSearchAnalysis.hpp	(revision 94d5ac60852caf3933c959f8314ca0be3d3a7c51)
+++ src/Graph/DepthFirstSearchAnalysis.hpp	(revision f968742be974e94db1c9b45ea28719c21790e2c1)
@@ -20,4 +20,5 @@
 class atom;
 class bond;
+class ListOfLocalAtoms_t;
 class MoleculeLeafClass;
 class molecule;
@@ -66,9 +67,9 @@
    * Reference is the internal BackEdgeStack.
    *
-   * \param **ListOfLocalAtoms array of father atom::nr to local atom::nr (reverse of atom::father)
+   * \param ListOfLocalAtoms array of father atom::nr to local atom::nr (reverse of atom::father)
    * \param *LocalStack stack to be filled
    * \return true - everything ok, false - ReferenceStack was empty
    */
-  bool PickLocalBackEdges(atom **ListOfLocalAtoms, std::deque<bond *> *&LocalStack) const;
+  bool PickLocalBackEdges(const ListOfLocalAtoms_t &ListOfLocalAtoms, std::deque<bond *> *&LocalStack) const;
 
   /** Getter for BackEdgeStack.
Index: src/Graph/ListOfLocalAtoms.hpp
===================================================================
--- src/Graph/ListOfLocalAtoms.hpp	(revision f968742be974e94db1c9b45ea28719c21790e2c1)
+++ src/Graph/ListOfLocalAtoms.hpp	(revision f968742be974e94db1c9b45ea28719c21790e2c1)
@@ -0,0 +1,33 @@
+/*
+ * ListOfLocalAtoms.hpp
+ *
+ *  Created on: Sep 7, 2012
+ *      Author: heber
+ */
+
+#ifndef LISTOFLOCALATOMS_HPP_
+#define LISTOFLOCALATOMS_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <map>
+
+#include "types.hpp"
+
+class atom;
+
+/** This structure contains the reverse lookup to atom::father entry.
+ *
+ * We want to know the copied atom from the original one.
+ *
+ */
+struct ListOfLocalAtoms_t : public std::map<atomId_t, atom *>
+{
+
+};
+
+#endif /* LISTOFLOCALATOMS_HPP_ */
Index: src/Graph/Makefile.am
===================================================================
--- src/Graph/Makefile.am	(revision 94d5ac60852caf3933c959f8314ca0be3d3a7c51)
+++ src/Graph/Makefile.am	(revision f968742be974e94db1c9b45ea28719c21790e2c1)
@@ -18,5 +18,6 @@
 	Graph/ConnectedSubgraph.hpp \
 	Graph/CyclicStructureAnalysis.hpp \
-	Graph/DepthFirstSearchAnalysis.hpp
+	Graph/DepthFirstSearchAnalysis.hpp \
+	Graph/ListOfLocalAtoms.hpp
 
 
