Index: src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision 188639b405c8485adb0bbb575d15d94b769a1b99)
+++ src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision 6ca578398c0a55a029ee81d176ca5bb849301f60)
@@ -39,4 +39,7 @@
 #include "CodePatterns/MemDebug.hpp"
 
+#include <boost/assign.hpp>
+
+#include "CodePatterns/Assert.hpp"
 #include "CodePatterns/Info.hpp"
 #include "CodePatterns/Log.hpp"
@@ -49,5 +52,8 @@
 #include "Fragmentation/Fragmentation.hpp"
 #include "Fragmentation/HydrogenSaturation_enum.hpp"
+#include "Fragmentation/KeySet.hpp"
 #include "Fragmentation/KeySetsContainer.hpp"
+#include "Fragmentation/Summation/OrthogonalSummation.hpp"
+#include "Fragmentation/Summation/SetValue.hpp"
 #include "Graph/DepthFirstSearchAnalysis.hpp"
 #include "Jobs/MPQCJob.hpp"
@@ -63,4 +69,6 @@
 
 using namespace MoleCuilder;
+
+using namespace boost::assign;
 
 // and construct the stuff
@@ -146,5 +154,4 @@
   ForceMatrix Force;
   ForceMatrix ForceFragments;
-  KeySetsContainer KeySet;
 
   // align fragments
@@ -235,12 +242,57 @@
     return false;
 
+  // initialise indices
+  KeySetsContainer KeySet;
+  if (!Energy.InitialiseIndices()) return false;
+
+  if (!Force.ParseIndices(KeySetFilename.c_str())) return false;
+
+  if (!KeySet.ParseKeySets(KeySetFilename.c_str(), Force.RowCounter, Force.MatrixCounter)) return false;
+
+  /// prepare for OrthogonalSummation
+
+  // gather all present indices in AllIndices
+  IndexSet::ptr AllIndices(new IndexSet);
+  for (KeySetsContainer::ArrayOfIntVectors::const_iterator iter = KeySet.KeySets.begin();
+      iter != KeySet.KeySets.end(); ++iter)
+    for(KeySetsContainer::IntVector::const_iterator keyiter = (*iter).begin();
+        keyiter != (*iter).end(); ++keyiter) {
+      if (*keyiter != -1)
+        (*AllIndices) += *keyiter;
+    }
+  LOG(1, "INFO: AllIndices is " << AllIndices << ".");
+  // create container with all keysets
+  IndexSetContainer::ptr container(new IndexSetContainer(AllIndices));
+  for (KeySetsContainer::ArrayOfIntVectors::const_iterator iter = KeySet.KeySets.begin();
+      iter != KeySet.KeySets.end(); ++iter) {
+    IndexSet tempset;
+    for(KeySetsContainer::IntVector::const_iterator keyiter = (*iter).begin();
+        keyiter != (*iter).end(); ++keyiter)
+      if (*keyiter != -1)
+        tempset += *keyiter;
+    container->insert(tempset);
+  }
+  // create the map of all keysets
+  SubsetMap::ptr subsetmap(new SubsetMap(*container));
+
+  // associate each index set with its value
+  {
+    const IndexSetContainer::Container_t &_container = container->getContainer();
+    OrthogonalSummation<double>::InputSets_t indices(_container.begin(), _container.end());
+    OrthogonalSummation<double>::InputValues_t values(_container.size(), 0.);
+    std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
+    std::vector<FragmentResult::ptr>::const_iterator resultiter = results.begin();
+    for (; dataiter != fragmentData.end(); ++dataiter, ++resultiter) {
+      const MPQCData &extractedData = *dataiter;
+      values[ MatrixNrLookup[(*resultiter)->getId()] ] = extractedData.energies.total;
+    }
+
+    // create the summation functor and evaluate
+    OrthogonalSummation<double> OS(indices, values, subsetmap);
+    const double energyresult = OS();
+    LOG(0, "STATUS: Resulting energy is " << energyresult << ".");
+  }
 
   // combine all found data
-  if (!Energy.InitialiseIndices()) return false;
-
-  if (!Force.ParseIndices(KeySetFilename.c_str())) return false;
-
-  if (!KeySet.ParseKeySets(KeySetFilename.c_str(), Force.RowCounter, Force.MatrixCounter)) return false;
-
   if (!KeySet.ParseManyBodyTerms()) return false;
 
Index: src/Jobs/MPQCJob.cpp
===================================================================
--- src/Jobs/MPQCJob.cpp	(revision 188639b405c8485adb0bbb575d15d94b769a1b99)
+++ src/Jobs/MPQCJob.cpp	(revision 6ca578398c0a55a029ee81d176ca5bb849301f60)
@@ -60,11 +60,13 @@
 FragmentResult::ptr MPQCJob::Work()
 {
+  // instantiate empty data
+  MPQCData data;
   std::stringstream returnstream;
-  MPQCData data;
-  // place into returnstream
   boost::archive::text_oarchive oa(returnstream);
   oa << data;
 
+  // create the result
   FragmentResult::ptr ptr( new FragmentResult(getId(), returnstream.str()) );
+
   return ptr;
 }
Index: src/UIElements/Makefile.am
===================================================================
--- src/UIElements/Makefile.am	(revision 188639b405c8485adb0bbb575d15d94b769a1b99)
+++ src/UIElements/Makefile.am	(revision 6ca578398c0a55a029ee81d176ca5bb849301f60)
@@ -247,4 +247,5 @@
 endif
 libMolecuilderUI_la_LIBADD += \
+	$(top_builddir)/src/Fragmentation/Summation/libMolecuilderFragmentationSummation.la \
 	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
 	${CodePatterns_LIBS} \
