Index: src/Fragmentation/Exporters/SphericalPointDistribution.cpp
===================================================================
--- src/Fragmentation/Exporters/SphericalPointDistribution.cpp	(revision 0d4dafbe84787fcd401029cb965986289730a17a)
+++ src/Fragmentation/Exporters/SphericalPointDistribution.cpp	(revision 90426a4e272b87619540d650458c3c1f358c718c)
@@ -39,4 +39,5 @@
 #include "CodePatterns/Assert.hpp"
 #include "CodePatterns/IteratorAdaptors.hpp"
+#include "CodePatterns/Log.hpp"
 #include "CodePatterns/toString.hpp"
 
@@ -102,5 +103,5 @@
 
   if (_Matching.size() > 1) {
-    // convert matching into two vectors to calculate distance among another
+    LOG(3, "INFO: Matching is " << _Matching);
 
     // calculate all pair-wise distances
@@ -123,5 +124,8 @@
       errors.second += gap*gap;
     }
-  }
+  } else
+    ELOG(2, "calculateErrorOfMatching() - Given matching is empty.");
+  LOG(3, "INFO: Resulting errors for matching (L1, L2): "
+      << errors.first << "," << errors.second << ".");
 
   return errors;
@@ -136,4 +140,5 @@
   IndexArray_t indices(_matchingindices.begin(), _matchingindices.end());
   std::sort(indices.begin(), indices.end());
+  LOG(4, "DEBUG: sorted matching is " << indices);
   IndexArray_t::const_iterator valueiter = indices.begin();
   SphericalPointDistribution::Polygon_t::const_iterator pointiter =
@@ -146,4 +151,5 @@
       remainingpoints.push_back(*pointiter);
   }
+  LOG(4, "DEBUG: remaining indices are " << remainingpoints);
 
   return remainingpoints;
@@ -173,4 +179,5 @@
       "rotatePolygon() - not exactly "+toString(3)+" angles given.");
   rotation.setRotation(_angles[0] * M_PI/180., _angles[1] * M_PI/180., _angles[2] * M_PI/180.);
+  LOG(4, "DEBUG: Rotation matrix is " << rotation);
 
   // apply rotation angles
@@ -205,7 +212,11 @@
     unsigned int _matchingsize)
 {
+  LOG(4, "DEBUG: Recursing with current matching " << _matching
+      << ", remaining indices " << _indices
+      << ", and sought size " << _matchingsize);
   //!> threshold for L1 error below which matching is immediately acceptable
   const double L1THRESHOLD = 1e-2;
   if (!_MCS.foundflag) {
+    LOG(3, "INFO: Current matching has size " << _matching.size() << " of " << _matchingsize);
     if (_matching.size() < _matchingsize) {
       // go through all indices
@@ -214,4 +225,5 @@
         // add index to matching
         _matching.push_back(*iter);
+        LOG(4, "DEBUG: Adding " << *iter << " to matching.");
         // remove index but keep iterator to position (is the next to erase element)
         IndexList_t::iterator backupiter = _indices.erase(iter);
@@ -227,4 +239,5 @@
       _MCS.foundflag = true;
     } else {
+      LOG(3, "INFO: Found matching " << _matching);
       // calculate errors
       std::pair<double, double> errors = calculateErrorOfMatching(
@@ -251,4 +264,6 @@
   VectorArray_t remainingold(_polygon.begin(), _polygon.end());
   VectorArray_t remainingnew(_newpolygon.begin(), _newpolygon.end());
+  LOG(3, "INFO: Matching old polygon " << _polygon
+      << " with new polygon " << _newpolygon);
 
   if (_polygon.size() > 0) {
@@ -272,4 +287,5 @@
       recurseMatchings(MCS, matching, indices, matchingsize);
     }
+    LOG(3, "INFO: Best matching is " << MCS.bestmatching);
 
     // determine rotation angles to align the two point distributions with
@@ -288,4 +304,5 @@
       oldCenter *= 1./(double)i;
       newCenter *= 1./(double)i;
+      LOG(3, "INFO: oldCenter is " << oldCenter << ", newCenter is " << newCenter);
 
       Vector direction(0.,0.,0.);
@@ -304,12 +321,16 @@
       }
     }
+    LOG(3, "INFO: (x,y,z) angles are" << angles);
     const Line RotationAxis(zeroVec, newCenter);
     const double RotationAngle =
         newCenter.Angle(remainingold[0])
         - newCenter.Angle(remainingnew[*MCS.bestmatching.begin()]);
+    LOG(3, "INFO: Rotate around self is " << RotationAngle
+        << " around axis " << RotationAxis);
 
     // rotate _newpolygon
     SphericalPointDistribution::Polygon_t rotated_newpolygon =
         rotatePolygon(_newpolygon, angles, RotationAxis, RotationAngle);
+    LOG(3, "INFO: Rotated new polygon is " << rotated_newpolygon);
 
     // remove all points in matching and return remaining ones
@@ -320,3 +341,2 @@
 
 
-
