Index: src/Potentials/Specifics/FourBodyPotential_Torsion.cpp
===================================================================
--- src/Potentials/Specifics/FourBodyPotential_Torsion.cpp	(revision 16227a32089e461901d97290d3e2fb626919cf26)
+++ src/Potentials/Specifics/FourBodyPotential_Torsion.cpp	(revision a42feea2484491fdb28f92c73043956e00a2d922)
@@ -140,85 +140,99 @@
 FourBodyPotential_Torsion::results_t
 FourBodyPotential_Torsion::operator()(
-    const arguments_t &arguments
+    const list_of_arguments_t &listarguments
     ) const
 {
-  ASSERT( arguments.size() == getSpecificArgumentCount(),
-      "FourBodyPotential_Torsion::operator() - requires exactly three arguments.");
-  ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
-      arguments, getParticleTypes()),
-      "FourBodyPotential_Torsion::operator() - types don't match with ones in arguments.");
-  const argument_t &r_ij = arguments[0]; // 01
-  const argument_t &r_ik = arguments[1]; // 02
-  const argument_t &r_il = arguments[2]; // 03
-  const argument_t &r_jk = arguments[3]; // 12
-  const argument_t &r_jl = arguments[4]; // 13
-  const argument_t &r_kl = arguments[5]; // 23
-  const result_t result =
-      params[spring_constant]
-             * Helpers::pow( function_theta(r_ij.distance, r_ik.distance, r_il.distance, r_jk.distance, r_jl.distance, r_kl.distance) - params[equilibrium_distance], 2 );
-  return std::vector<result_t>(1, result);
+  result_t result = 0.;
+  for(list_of_arguments_t::const_iterator iter = listarguments.begin();
+      iter != listarguments.end(); ++iter) {
+    const arguments_t &arguments = *iter;
+    ASSERT( arguments.size() == getSpecificArgumentCount(),
+        "FourBodyPotential_Torsion::operator() - requires exactly three arguments.");
+    ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
+        arguments, getParticleTypes()),
+        "FourBodyPotential_Torsion::operator() - types don't match with ones in arguments.");
+    const argument_t &r_ij = arguments[0]; // 01
+    const argument_t &r_ik = arguments[1]; // 02
+    const argument_t &r_il = arguments[2]; // 03
+    const argument_t &r_jk = arguments[3]; // 12
+    const argument_t &r_jl = arguments[4]; // 13
+    const argument_t &r_kl = arguments[5]; // 23
+    result +=
+        params[spring_constant]
+               * Helpers::pow( function_theta(r_ij.distance, r_ik.distance, r_il.distance, r_jk.distance, r_jl.distance, r_kl.distance)
+                   - params[equilibrium_distance], 2 );
+  }
+  return results_t(1, result);
 }
 
 FourBodyPotential_Torsion::derivative_components_t
 FourBodyPotential_Torsion::derivative(
-    const arguments_t &arguments
+    const list_of_arguments_t &listarguments
     ) const
 {
-  ASSERT( arguments.size() == getSpecificArgumentCount(),
-      "FourBodyPotential_Torsion::operator() - requires exactly three arguments.");
-  ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
-      arguments, getParticleTypes()),
-      "FourBodyPotential_Torsion::operator() - types don't match with ones in arguments.");
-  derivative_components_t result;
-  const argument_t &r_ij = arguments[0]; // 01
-  const argument_t &r_ik = arguments[1]; // 02
-  const argument_t &r_il = arguments[2]; // 03
-  const argument_t &r_jk = arguments[3]; // 12
-  const argument_t &r_jl = arguments[4]; // 13
-  const argument_t &r_kl = arguments[5]; // 23
-  result.push_back( 2. * params[spring_constant] * ( function_theta(r_ij.distance, r_ik.distance, r_il.distance, r_jk.distance, r_jl.distance, r_kl.distance) - params[equilibrium_distance]) );
-  ASSERT( result.size() == 1,
-      "FourBodyPotential_Torsion::operator() - we did not create exactly one component.");
-  return result;
+  result_t result = 0.;
+  for(list_of_arguments_t::const_iterator iter = listarguments.begin();
+      iter != listarguments.end(); ++iter) {
+    const arguments_t &arguments = *iter;
+    ASSERT( arguments.size() == getSpecificArgumentCount(),
+        "FourBodyPotential_Torsion::operator() - requires exactly three arguments.");
+    ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
+        arguments, getParticleTypes()),
+        "FourBodyPotential_Torsion::operator() - types don't match with ones in arguments.");
+    const argument_t &r_ij = arguments[0]; // 01
+    const argument_t &r_ik = arguments[1]; // 02
+    const argument_t &r_il = arguments[2]; // 03
+    const argument_t &r_jk = arguments[3]; // 12
+    const argument_t &r_jl = arguments[4]; // 13
+    const argument_t &r_kl = arguments[5]; // 23
+    result +=
+        2. * params[spring_constant] *
+        ( function_theta(r_ij.distance, r_ik.distance, r_il.distance, r_jk.distance, r_jl.distance, r_kl.distance)
+            - params[equilibrium_distance]);
+  }
+  return derivative_components_t(1, result);
 }
 
 FourBodyPotential_Torsion::results_t
 FourBodyPotential_Torsion::parameter_derivative(
-    const arguments_t &arguments,
+    const list_of_arguments_t &listarguments,
     const size_t index
     ) const
 {
-  ASSERT( arguments.size() == getSpecificArgumentCount(),
-      "FourBodyPotential_Torsion::parameter_derivative() - requires exactly three arguments.");
-  ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
-      arguments, getParticleTypes()),
-      "FourBodyPotential_Torsion::operator() - types don't match with ones in arguments.");
-  const argument_t &r_ij = arguments[0]; // 01
-  const argument_t &r_ik = arguments[1]; // 02
-  const argument_t &r_il = arguments[2]; // 03
-  const argument_t &r_jk = arguments[3]; // 12
-  const argument_t &r_jl = arguments[4]; // 13
-  const argument_t &r_kl = arguments[5]; // 23
-  switch (index) {
-    case spring_constant:
-    {
-      const result_t result =
-                 Helpers::pow( function_theta(r_ij.distance, r_ik.distance, r_il.distance, r_jk.distance, r_jl.distance, r_kl.distance) - params[equilibrium_distance], 2 );
-      return std::vector<result_t>(1, result);
-      break;
+  result_t result = 0.;
+  for(list_of_arguments_t::const_iterator iter = listarguments.begin();
+      iter != listarguments.end(); ++iter) {
+    const arguments_t &arguments = *iter;
+    ASSERT( arguments.size() == getSpecificArgumentCount(),
+        "FourBodyPotential_Torsion::parameter_derivative() - requires exactly three arguments.");
+    ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
+        arguments, getParticleTypes()),
+        "FourBodyPotential_Torsion::operator() - types don't match with ones in arguments.");
+    const argument_t &r_ij = arguments[0]; // 01
+    const argument_t &r_ik = arguments[1]; // 02
+    const argument_t &r_il = arguments[2]; // 03
+    const argument_t &r_jk = arguments[3]; // 12
+    const argument_t &r_jl = arguments[4]; // 13
+    const argument_t &r_kl = arguments[5]; // 23
+    switch (index) {
+      case spring_constant:
+      {
+        result +=
+            Helpers::pow( function_theta(r_ij.distance, r_ik.distance, r_il.distance, r_jk.distance, r_jl.distance, r_kl.distance) - params[equilibrium_distance], 2 );
+        break;
+      }
+      case equilibrium_distance:
+      {
+        result +=
+            -2. * params[spring_constant]
+                   * ( function_theta(r_ij.distance, r_ik.distance, r_il.distance, r_jk.distance, r_jl.distance, r_kl.distance) - params[equilibrium_distance]);
+        break;
+      }
+      default:
+        ASSERT(0, "FourBodyPotential_Torsion::parameter_derivative() - derivative to unknown parameter desired.");
+        break;
     }
-    case equilibrium_distance:
-    {
-      const result_t result =
-          -2. * params[spring_constant]
-                 * ( function_theta(r_ij.distance, r_ik.distance, r_il.distance, r_jk.distance, r_jl.distance, r_kl.distance) - params[equilibrium_distance]);
-      return std::vector<result_t>(1, result);
-      break;
-    }
-    default:
-      ASSERT(0, "FourBodyPotential_Torsion::parameter_derivative() - derivative to unknown parameter desired.");
-      break;
   }
-  return std::vector<result_t>(1);
+  return results_t(1, result);
 }
 
