Index: src/Fragmentation/BondsPerShortestPath.cpp
===================================================================
--- src/Fragmentation/BondsPerShortestPath.cpp	(revision 246e135b36a823fc68a5447dc711b024f2d49ce7)
+++ src/Fragmentation/BondsPerShortestPath.cpp	(revision f0674ad457e26229a9fc919b6f3659591649bf06)
@@ -27,4 +27,5 @@
 #include "Bond/bond.hpp"
 #include "Element/element.hpp"
+#include "Fragmentation/KeySet.hpp"
 
 BondsPerShortestPath::BondsPerShortestPath(int _Order) :
Index: src/Fragmentation/Fragmentation.cpp
===================================================================
--- src/Fragmentation/Fragmentation.cpp	(revision 246e135b36a823fc68a5447dc711b024f2d49ce7)
+++ src/Fragmentation/Fragmentation.cpp	(revision f0674ad457e26229a9fc919b6f3659591649bf06)
@@ -29,4 +29,5 @@
 #include "Element/periodentafel.hpp"
 #include "Fragmentation/fragmentation_helpers.hpp"
+#include "Fragmentation/KeySet.hpp"
 #include "Fragmentation/PowerSetGenerator.hpp"
 #include "Fragmentation/UniqueFragments.hpp"
Index: src/Fragmentation/Fragmentation.hpp
===================================================================
--- src/Fragmentation/Fragmentation.hpp	(revision 246e135b36a823fc68a5447dc711b024f2d49ce7)
+++ src/Fragmentation/Fragmentation.hpp	(revision f0674ad457e26229a9fc919b6f3659591649bf06)
@@ -20,4 +20,5 @@
 
 class atom;
+class KeySet;
 class molecule;
 
Index: src/Fragmentation/KeySet.cpp
===================================================================
--- src/Fragmentation/KeySet.cpp	(revision f0674ad457e26229a9fc919b6f3659591649bf06)
+++ src/Fragmentation/KeySet.cpp	(revision f0674ad457e26229a9fc919b6f3659591649bf06)
@@ -0,0 +1,67 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * KeySet.cpp
+ *
+ *  Created on: Oct 20, 2011
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "KeySet.hpp"
+
+/** Constructor of class KeySet.
+ *
+ * This class contains a set of indices for the atoms contained in a fragment.
+ *
+ */
+KeySet::KeySet()
+{}
+
+/** Destructor of class KeySet.
+ *
+ */
+KeySet::~KeySet()
+{}
+
+
+/** Comparator to allow for placing in a map.
+ *
+ * @param a instance to compare to
+ * @return true - this instance has less items or the first different item itself is less,
+ *         false - else
+ */
+bool KeySet::operator<(const KeySet &a) const
+{
+  //Log() << Verbose(0) << "my check is used." << endl;
+  if (size() < a.size()) {
+    return true;
+  } else {
+    if (size() > a.size()) {
+      return false;
+    } else {
+      KeySet::iterator IteratorA = begin();
+      KeySet::iterator IteratorB = a.begin();
+      while ((IteratorA != end()) && (IteratorB != a.end())) {
+        if ((*IteratorA) <  (*IteratorB))
+          return true;
+        else if ((*IteratorA) > (*IteratorB)) {
+            return false;
+          } // else, go on to next index
+        IteratorA++;
+        IteratorB++;
+      } // end of while loop
+    }// end of check in case of equal sizes
+  }
+  return false; // if we reach this point, they are equal
+}
Index: src/Fragmentation/KeySet.hpp
===================================================================
--- src/Fragmentation/KeySet.hpp	(revision f0674ad457e26229a9fc919b6f3659591649bf06)
+++ src/Fragmentation/KeySet.hpp	(revision f0674ad457e26229a9fc919b6f3659591649bf06)
@@ -0,0 +1,29 @@
+/*
+ * KeySet.hpp
+ *
+ *  Created on: Oct 20, 2011
+ *      Author: heber
+ */
+
+#ifndef KEYSET_HPP_
+#define KEYSET_HPP_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <set>
+
+
+class KeySet : public std::set<int>
+{
+public:
+  KeySet();
+  ~KeySet();
+
+  bool operator<(const KeySet &a) const;
+};
+
+typedef std::pair<KeySet::iterator, bool> KeySetTestPair;
+
+#endif /* KEYSET_HPP_ */
Index: src/Fragmentation/Makefile.am
===================================================================
--- src/Fragmentation/Makefile.am	(revision 246e135b36a823fc68a5447dc711b024f2d49ce7)
+++ src/Fragmentation/Makefile.am	(revision f0674ad457e26229a9fc919b6f3659591649bf06)
@@ -10,4 +10,5 @@
 	Fragmentation/helpers.cpp \
 	Fragmentation/HessianMatrix.cpp \
+	Fragmentation/KeySet.cpp \
 	Fragmentation/KeySetsContainer.cpp \
 	Fragmentation/MatrixContainer.cpp \
@@ -24,4 +25,5 @@
 	Fragmentation/helpers.hpp \
 	Fragmentation/HessianMatrix.hpp \
+	Fragmentation/KeySet.hpp \
 	Fragmentation/KeySetsContainer.hpp \
 	Fragmentation/MatrixContainer.hpp \
Index: src/Fragmentation/PowerSetGenerator.cpp
===================================================================
--- src/Fragmentation/PowerSetGenerator.cpp	(revision 246e135b36a823fc68a5447dc711b024f2d49ce7)
+++ src/Fragmentation/PowerSetGenerator.cpp	(revision f0674ad457e26229a9fc919b6f3659591649bf06)
@@ -26,4 +26,5 @@
 #include "atom.hpp"
 #include "Bond/bond.hpp"
+#include "Fragmentation/KeySet.hpp"
 #include "Fragmentation/UniqueFragments.hpp"
 
Index: src/Fragmentation/UniqueFragments.cpp
===================================================================
--- src/Fragmentation/UniqueFragments.cpp	(revision 246e135b36a823fc68a5447dc711b024f2d49ce7)
+++ src/Fragmentation/UniqueFragments.cpp	(revision f0674ad457e26229a9fc919b6f3659591649bf06)
@@ -27,4 +27,5 @@
 #include "Bond/bond.hpp"
 #include "Element/element.hpp"
+#include "Fragmentation/KeySet.hpp"
 #include "graph.hpp"
 
Index: src/Fragmentation/fragmentation_helpers.cpp
===================================================================
--- src/Fragmentation/fragmentation_helpers.cpp	(revision 246e135b36a823fc68a5447dc711b024f2d49ce7)
+++ src/Fragmentation/fragmentation_helpers.cpp	(revision f0674ad457e26229a9fc919b6f3659591649bf06)
@@ -29,4 +29,5 @@
 #include "Bond/bond.hpp"
 #include "Element/element.hpp"
+#include "Fragmentation/KeySet.hpp"
 #include "Helpers/defs.hpp"
 #include "Helpers/helpers.hpp"
@@ -424,31 +425,4 @@
 };
 
-
-
-bool KeyCompare::operator() (const KeySet SubgraphA, const KeySet SubgraphB) const
-{
-  //Log() << Verbose(0) << "my check is used." << endl;
-  if (SubgraphA.size() < SubgraphB.size()) {
-    return true;
-  } else {
-    if (SubgraphA.size() > SubgraphB.size()) {
-      return false;
-    } else {
-      KeySet::iterator IteratorA = SubgraphA.begin();
-      KeySet::iterator IteratorB = SubgraphB.begin();
-      while ((IteratorA != SubgraphA.end()) && (IteratorB != SubgraphB.end())) {
-        if ((*IteratorA) <  (*IteratorB))
-          return true;
-        else if ((*IteratorA) > (*IteratorB)) {
-            return false;
-          } // else, go on to next index
-        IteratorA++;
-        IteratorB++;
-      } // end of while loop
-    }// end of check in case of equal sizes
-  }
-  return false; // if we reach this point, they are equal
-};
-
 /** Combines all KeySets from all orders into single ones (with just unique entries).
  * \param *out output stream for debugging
