Index: src/LevMartester.cpp
===================================================================
--- src/LevMartester.cpp	(revision b10ada8800f87099427e2d2428ed97af7db6968a)
+++ src/LevMartester.cpp	(revision b3eabc5ab97979bd66a5016b2618193a6479b544)
@@ -331,5 +331,5 @@
               _2)
           );
-//          TrainingData::extractor_t(&Extractors::gatherAllDistances) // gather first carbon pair
+//          TrainingData::extractor_t(&Extractors::gatherAllSymmetricDistances) // gather first carbon pair
 //          );
       TersoffData( homologies.getHomologousGraphs(graph) );
Index: src/Potentials/Specifics/SaturationPotential.cpp
===================================================================
--- src/Potentials/Specifics/SaturationPotential.cpp	(revision b10ada8800f87099427e2d2428ed97af7db6968a)
+++ src/Potentials/Specifics/SaturationPotential.cpp	(revision b3eabc5ab97979bd66a5016b2618193a6479b544)
@@ -75,4 +75,5 @@
 SaturationPotential::SaturationPotential(
     const ParticleTypes_t &_ParticleTypes,
+    const double _all_energy_offset,
     const double _morse_spring_constant,
     const double _morse_equilibrium_distance,
@@ -80,5 +81,4 @@
     const double _angle_spring_constant,
     const double _angle_equilibrium_distance,
-    const double _all_energy_offset,
     const double _saturation_cutoff,
     boost::function< std::vector<arguments_t>(const argument_t &, const double)> &_triplefunction) :
@@ -182,22 +182,28 @@
       if (result != result)
         ELOG(1, "result is NAN.");
-
-      // Angle contribution
-      std::vector<arguments_t> triples = triplefunction(r_ij, saturation_cutoff);
-      args.resize(3, r_ij);
-      for (std::vector<arguments_t>::const_iterator iter = triples.begin();
-          iter != triples.end(); ++iter) {
-        ASSERT( iter->size() == 2,
-            "SaturationPotential::function_derivative_c() - the triples result must contain exactly two distances.");
-        const argument_t &r_ik = (*iter)[0];
-        const argument_t &r_jk = (*iter)[1];
-        args[1] = r_ik;
-        args[2] = r_jk;
-        result += .5*angle(args)[0];  // as we have all distances we get both jk and kj
-        if (result != result)
-          ELOG(1, "result is NAN.");
-      }
-    }
-  }
+    }
+  }
+  // Angle contribution
+  result += angle(arguments)[0];  // as we have all distances we get both jk and kj
+  if (result != result)
+    ELOG(1, "result is NAN.");
+//
+//      // Angle contribution
+//      std::vector<arguments_t> triples = triplefunction(r_ij, saturation_cutoff);
+//      args.resize(3, r_ij);
+//      for (std::vector<arguments_t>::const_iterator iter = triples.begin();
+//          iter != triples.end(); ++iter) {
+//        ASSERT( iter->size() == 2,
+//            "SaturationPotential::function_derivative_c() - the triples result must contain exactly two distances.");
+//        const argument_t &r_ik = (*iter)[0];
+//        const argument_t &r_jk = (*iter)[1];
+//        args[1] = r_ik;
+//        args[2] = r_jk;
+//        result += .5*angle(args)[0];  // as we have all distances we get both jk and kj
+//        if (result != result)
+//          ELOG(1, "result is NAN.");
+//      }
+//    }
+//  }
   return std::vector<result_t>(1, energy_offset + result);
 }
@@ -221,67 +227,53 @@
 {
   double result = 0.;
-  if (index == all_energy_offset) {
-    result = 1.;
-  } else {
-    for(arguments_t::const_iterator argiter = arguments.begin();
-        argiter != arguments.end();
-        ++argiter) {
-      const argument_t &r_ij = *argiter;
-      if ((r_ij.indices.first == 0)) { // first item must be the non-hydrogen
-        arguments_t args(1, r_ij);
-        switch (index) {
-          case morse_spring_constant:
-          {
-            result += morse.parameter_derivative(args, PairPotential_Morse::spring_constant)[0];
-            break;
-          }
-          case morse_equilibrium_distance:
-          {
-            result += morse.parameter_derivative(args, PairPotential_Morse::equilibrium_distance)[0];
-            break;
-          }
-          case morse_dissociation_energy:
-          {
-            result += morse.parameter_derivative(args, PairPotential_Morse::dissociation_energy)[0];
-            break;
-          }
-          default:
-          {
-            args.resize(3, r_ij);
-            std::vector<arguments_t> triples = triplefunction(r_ij, saturation_cutoff);
-            for (std::vector<arguments_t>::const_iterator iter = triples.begin();
-                iter != triples.end(); ++iter) {
-              ASSERT( iter->size() == 2,
-                  "SaturationPotential::parameter_derivative() - the triples result must contain exactly two distances.");
-              const argument_t &r_ik = (*iter)[0];
-              ASSERT( r_ik.indices.first == r_ij.indices.first,
-                  "SaturationPotential::parameter_derivative() - i not same in ij, ik.");
-              const argument_t &r_jk = (*iter)[1];
-              ASSERT( r_jk.indices.first == r_ij.indices.second,
-                  "SaturationPotential::parameter_derivative() - j not same in ij, jk.");
-              ASSERT( r_ik.indices.second == r_jk.indices.second,
-                  "SaturationPotential::parameter_derivative() - k not same in ik, jk.");
-              args[1] = r_ik;
-              args[2] = r_jk;
-              switch (index) {   // .5 due to we have all distances we get both jk and kj
-                case angle_spring_constant:
-                {
-                  result += .5*angle.parameter_derivative(args, PairPotential_Angle::spring_constant)[0];
-                  break;
-                }
-                case angle_equilibrium_distance:
-                {
-                  result += .5*angle.parameter_derivative(args, PairPotential_Angle::equilibrium_distance)[0];
-                  break;
-                }
-                default:
-                  break;
-              }
-            }
-            break;
+  switch (index) {
+    case all_energy_offset:
+    {
+      result = 1.;
+      break;
+    }
+    case morse_spring_constant:
+    case morse_equilibrium_distance:
+    case morse_dissociation_energy:
+    {
+      const ParticleTypes_t &morse_types = morse.getParticleTypes();
+      for(arguments_t::const_iterator argiter = arguments.begin();
+          argiter != arguments.end();
+          ++argiter) {
+        const argument_t &r_ij = *argiter;
+        if (((r_ij.types.first == morse_types[0]) && (r_ij.types.second == morse_types[1]))
+            || ((r_ij.types.first == morse_types[1]) && (r_ij.types.second == morse_types[0]))) {
+          arguments_t args(1, r_ij);
+          switch (index) {
+            case morse_spring_constant:
+              result += morse.parameter_derivative(args, PairPotential_Morse::spring_constant)[0];
+              break;
+            case morse_equilibrium_distance:
+              result += morse.parameter_derivative(args, PairPotential_Morse::equilibrium_distance)[0];
+              break;
+            case morse_dissociation_energy:
+              result += morse.parameter_derivative(args, PairPotential_Morse::dissociation_energy)[0];
+              break;
+            default:
+              ASSERT( 0, "SaturationPotential::parameter_derivative() - impossible to get here.");
+              break;
           }
         }
       }
-    }
+      break;
+    }
+    case angle_spring_constant:
+    {
+      result = angle.parameter_derivative(arguments, PairPotential_Angle::spring_constant)[0];
+      break;
+    }
+    case angle_equilibrium_distance:
+    {
+      result = angle.parameter_derivative(arguments, PairPotential_Angle::equilibrium_distance)[0];
+      break;
+    }
+    default:
+      ELOG(1, "SaturationPotential::parameter_derivative() - index " << index << " invalid.");
+      break;
   }
   return SaturationPotential::results_t(1, result);
Index: src/Potentials/Specifics/SaturationPotential.hpp
===================================================================
--- src/Potentials/Specifics/SaturationPotential.hpp	(revision b10ada8800f87099427e2d2428ed97af7db6968a)
+++ src/Potentials/Specifics/SaturationPotential.hpp	(revision b3eabc5ab97979bd66a5016b2618193a6479b544)
@@ -54,4 +54,5 @@
   SaturationPotential(
       const ParticleTypes_t &_ParticleTypes,
+      const double _all_energy_offset,
       const double _morse_spring_constant,
       const double _morse_equilibrium_distance,
@@ -59,5 +60,4 @@
       const double _angle_spring_constant,
       const double _angle_equilibrium_distance,
-      const double _energy_offset,
       const double _saturation_cutoff,
       boost::function< std::vector<arguments_t>(const argument_t &, const double)> &_triplefunction
