Index: src/Dynamics/BondVectors.cpp
===================================================================
--- src/Dynamics/BondVectors.cpp	(revision 9861d079c485b02a0832c53c01c21806c33af872)
+++ src/Dynamics/BondVectors.cpp	(revision 825d33ebc21aba34ee75cf5b91ec473219e8af9f)
@@ -39,5 +39,7 @@
 
 #include <algorithm>
+#include <functional>
 #include <iterator>
+#include <numeric>
 
 #include "CodePatterns/Assert.hpp"
@@ -46,4 +48,5 @@
 #include "Atom/atom.hpp"
 #include "Bond/bond.hpp"
+#include "Helpers/defs.hpp"
 
 void BondVectors::recalculateBondVectorsAtStep(
@@ -107,2 +110,52 @@
   return BondVectors;
 }
+
+BondVectors::weights_t BondVectors::getWeightsForAtomAtStep(
+    const atom &_walker,
+    const size_t &_step) const
+{
+  const std::vector<Vector> BondVectors =
+      getAtomsBondVectorsAtStep(_walker, _step);
+
+  weights_t weights;
+  for (std::vector<Vector>::const_iterator iter = BondVectors.begin();
+      iter != BondVectors.end(); ++iter) {
+    std::vector<double> scps;
+    scps.reserve(BondVectors.size());
+    std::transform(
+        BondVectors.begin(), BondVectors.end(),
+        std::back_inserter(scps),
+        boost::bind(static_cast< double (*)(double) >(&fabs),
+            boost::bind(&Vector::ScalarProduct, boost::cref(*iter), _1))
+        );
+    const double scp_sum = std::accumulate(scps.begin(), scps.end(), 0.);
+    ASSERT( (scp_sum-1.) > -MYEPSILON,
+        "ForceAnnealing() - sum of weights must be equal or larger one but is "
+        +toString(scp_sum));
+    weights.push_back( 1./scp_sum );
+  }
+  LOG(4, "DEBUG: Weights for atom #" << _walker.getId() << ": " << weights);
+
+  // for testing we check whether all weighted scalar products now come out as 1.
+#ifndef NDEBUG
+  for (std::vector<Vector>::const_iterator iter = BondVectors.begin();
+      iter != BondVectors.end(); ++iter) {
+    std::vector<double> scps;
+    scps.reserve(BondVectors.size());
+    std::transform(
+        BondVectors.begin(), BondVectors.end(),
+        weights.begin(),
+        std::back_inserter(scps),
+        boost::bind(static_cast< double (*)(double) >(&fabs),
+            boost::bind(std::multiplies<double>(),
+                boost::bind(&Vector::ScalarProduct, boost::cref(*iter), _1),
+                _2))
+        );
+    const double scp_sum = std::accumulate(scps.begin(), scps.end(), 0.);
+    ASSERT( fabs(scp_sum - 1.) < MYEPSILON,
+        "ForceAnnealing::operator() - for BondVector "+toString(*iter)
+        +" we have weighted scalar product of "+toString(scp_sum)+" != 1.");
+  }
+#endif
+  return weights;
+}
Index: src/Dynamics/BondVectors.hpp
===================================================================
--- src/Dynamics/BondVectors.hpp	(revision 9861d079c485b02a0832c53c01c21806c33af872)
+++ src/Dynamics/BondVectors.hpp	(revision 825d33ebc21aba34ee75cf5b91ec473219e8af9f)
@@ -83,4 +83,20 @@
       const size_t &_step) const;
 
+  //!> typedef for the weights for the Bondvectors of a single atom
+  typedef std::deque<double> weights_t;
+
+  /** Calculates the weights for a frame where each Bondvector of the
+   * given atom is a vector of the frame.
+   *
+   * The idea is that we can represent any vector by appropriate weights such
+   * that is still sums up to one.
+   *
+   * \param _walker atom to get BondVectors for
+   * \param _step time step for which the bond vector is request
+   */
+  weights_t getWeightsForAtomAtStep(
+      const atom &_walker,
+      const size_t &_step) const;
+
 private:
   /** Calculates the bond vector for each bond in the internal container.
Index: src/Dynamics/ForceAnnealing.hpp
===================================================================
--- src/Dynamics/ForceAnnealing.hpp	(revision 9861d079c485b02a0832c53c01c21806c33af872)
+++ src/Dynamics/ForceAnnealing.hpp	(revision 825d33ebc21aba34ee75cf5b91ec473219e8af9f)
@@ -292,6 +292,5 @@
 
     // for each atom we need to gather weights and then project the gradient
-    typedef std::deque<double> weights_t;
-    typedef std::map<atomId_t, weights_t > weights_per_atom_t;
+    typedef std::map<atomId_t, BondVectors::weights_t > weights_per_atom_t;
     std::vector<weights_per_atom_t> weights_per_atom(2);
     for (size_t timestep = 0; timestep <= 1; ++timestep) {
@@ -313,59 +312,26 @@
 
           // gather subset of BondVectors for the current atom
-          std::vector<Vector> BondVectors = bv.getAtomsBondVectorsAtStep(walker, CurrentStep);
+          const std::vector<Vector> BondVectors =
+              bv.getAtomsBondVectorsAtStep(walker, CurrentStep);
 
           // go through all its bonds and calculate what magnitude is represented
           // by the others i.e. sum of scalar products against other bonds
-          std::pair<weights_per_atom_t::iterator, bool> inserter =
+          const std::pair<weights_per_atom_t::iterator, bool> inserter =
               weights_per_atom[timestep].insert(
-                  std::make_pair(walker.getId(), weights_t()) );
+                  std::make_pair(walker.getId(),
+                  bv.getWeightsForAtomAtStep(walker, CurrentStep)) );
           ASSERT( inserter.second,
               "ForceAnnealing::operator() - weight map for atom "+toString(walker)
               +" and time step "+toString(timestep)+" already filled?");
-          weights_t &weights = inserter.first->second;
-          for (std::vector<Vector>::const_iterator iter = BondVectors.begin();
-              iter != BondVectors.end(); ++iter) {
-            std::vector<double> scps;
-            scps.reserve(BondVectors.size());
-            std::transform(
-                BondVectors.begin(), BondVectors.end(),
-                std::back_inserter(scps),
-                boost::bind(static_cast< double (*)(double) >(&fabs),
-                    boost::bind(&Vector::ScalarProduct, boost::cref(*iter), _1))
-                );
-            const double scp_sum = std::accumulate(scps.begin(), scps.end(), 0.);
-            ASSERT( (scp_sum-1.) > -MYEPSILON,
-                "ForceAnnealing() - sum of weights must be equal or larger one but is "
-                +toString(scp_sum));
-            weights.push_back( 1./scp_sum );
-          }
-          LOG(4, "DEBUG: Weights for atom #" << walker.getId() << ": " << weights);
-
-          // for testing we check whether all weighted scalar products now come out as 1.
-#ifndef NDEBUG
-          for (std::vector<Vector>::const_iterator iter = BondVectors.begin();
-              iter != BondVectors.end(); ++iter) {
-            std::vector<double> scps;
-            scps.reserve(BondVectors.size());
-            std::transform(
-                BondVectors.begin(), BondVectors.end(),
-                weights.begin(),
-                std::back_inserter(scps),
-                boost::bind(static_cast< double (*)(double) >(&fabs),
-                    boost::bind(std::multiplies<double>(),
-                        boost::bind(&Vector::ScalarProduct, boost::cref(*iter), _1),
-                        _2))
-                );
-            const double scp_sum = std::accumulate(scps.begin(), scps.end(), 0.);
-            ASSERT( fabs(scp_sum - 1.) < MYEPSILON,
-                "ForceAnnealing::operator() - for BondVector "+toString(*iter)
-                +" we have weighted scalar product of "+toString(scp_sum)+" != 1.");
-          }
-#endif
+          BondVectors::weights_t &weights = inserter.first->second;
+          ASSERT( weights.size() == ListOfBonds.size(),
+              "ForceAnnealing::operator() - number of weights "
+              +toString(weights.size())+" does not match number of bonds "
+              +toString(ListOfBonds.size())+", error in calculation?");
 
           // projected gradient over all bonds and place in one of projected_forces
           // using the obtained weights
           {
-            weights_t::const_iterator weightiter = weights.begin();
+            BondVectors::weights_t::const_iterator weightiter = weights.begin();
             std::vector<Vector>::const_iterator vectoriter = BondVectors.begin();
             Vector forcesum_check;
