Index: src/Actions/UndoRedoHelpers.cpp
===================================================================
--- src/Actions/UndoRedoHelpers.cpp	(revision 4424959d82789202040886c380e14457ae068293)
+++ src/Actions/UndoRedoHelpers.cpp	(revision 7e51e12e82c5637d2660d794f1e024fda52a5aa6)
@@ -3,4 +3,5 @@
  * Description: creates and alters molecular systems
  * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Copyright (C)  2013-2014 Frederik Heber. All rights reserved.
  * 
  *
@@ -38,5 +39,7 @@
 #include "UndoRedoHelpers.hpp"
 
+#include <boost/bind.hpp>
 #include <boost/foreach.hpp>
+#include <boost/function.hpp>
 
 #include "Atom/atom.hpp"
@@ -47,4 +50,5 @@
 #include "CodePatterns/Log.hpp"
 #include "World.hpp"
+#include "WorldTime.hpp"
 
 bool MoleCuilder::AddAtomsFromAtomicInfo(std::vector<AtomicInfo> &atoms)
@@ -103,7 +107,7 @@
 }
 
-void MoleCuilder::SetAtomsFromAtomicInfo(std::vector<AtomicInfo> &movedatoms)
-{
-  BOOST_FOREACH( const AtomicInfo &_atominfo, movedatoms) {
+void MoleCuilder::SetAtomsFromAtomicInfo(const std::vector<AtomicInfo> &_movedatoms)
+{
+  BOOST_FOREACH( const AtomicInfo &_atominfo, _movedatoms) {
     const atomId_t id = _atominfo.getId();
     atom * const _atom = World::getInstance().getAtom(AtomById(id));
@@ -115,7 +119,7 @@
 }
 
-void MoleCuilder::SelectAtomsFromAtomicInfo(std::vector<AtomicInfo> &movedatoms)
-{
-  BOOST_FOREACH( const AtomicInfo &_atominfo, movedatoms) {
+void MoleCuilder::SelectAtomsFromAtomicInfo(const std::vector<AtomicInfo> &_movedatoms)
+{
+  BOOST_FOREACH( const AtomicInfo &_atominfo, _movedatoms) {
     const atomId_t id = _atominfo.getId();
     World::getInstance().selectAtom(id);
@@ -124,4 +128,28 @@
 
 void MoleCuilder::ResetAtomPosition(const std::vector<AtomicInfo> &movedatoms, const std::vector<Vector> &MovedToVector)
+{
+  boost::function<void(atom *, const Vector&)> setter =
+      boost::bind(&atom::setPosition, _1, _2);
+  ResetByFunction(movedatoms, MovedToVector, setter);
+}
+
+void MoleCuilder::ResetAtomVelocity(const std::vector<AtomicInfo> &movedatoms, const std::vector<Vector> &VelocityVector)
+{
+  boost::function<void(atom *, const Vector&)> setter =
+      boost::bind(&atom::setAtomicVelocity, _1, _2);
+  ResetByFunction(movedatoms, VelocityVector, setter);
+}
+
+void MoleCuilder::ResetAtomForce(const std::vector<AtomicInfo> &movedatoms, const std::vector<Vector> &ForceVector)
+{
+  boost::function<void(atom *, const Vector&)> setter =
+      boost::bind(&atom::setAtomicForce, _1, _2);
+  ResetByFunction(movedatoms, ForceVector, setter);
+}
+
+void MoleCuilder::ResetByFunction(
+    const std::vector<AtomicInfo> &movedatoms,
+    const std::vector<Vector> &MovedToVector,
+    boost::function<void(atom *, const Vector&)> &setter)
 {
   std::vector<Vector>::const_iterator positer = MovedToVector.begin();
@@ -136,5 +164,5 @@
         "FillSphericalSurfaceAction::performRedo() - cannot find atom with id "
         +toString(id)+" in the world.");
-    _atom->setPosition( *positer );
+    setter(_atom, *positer );
     ++positer;
   }
@@ -152,2 +180,36 @@
   }
 }
+
+void MoleCuilder::removeLastStep(const std::vector<atomId_t> &_atoms)
+{
+  for (size_t i=0; i<_atoms.size(); ++i) {
+    atom * const _atom = World::getInstance().getAtom(AtomById(_atoms[i]));
+    _atom->removeSteps();
+  }
+}
+
+void MoleCuilder::addNewStep(const std::vector<AtomicInfo> &_movedatoms)
+{
+  for(size_t i=0; i< _movedatoms.size(); ++i) {
+    atom * const _atom = World::getInstance().getAtom(AtomById(_movedatoms[i].getId()));
+    _atom->UpdateSteps();
+  }
+}
+
+void MoleCuilder::addNewStep(const std::vector<atomId_t> &_ids)
+{
+  for(size_t i=0; i< _ids.size(); ++i) {
+    atom * const _atom = World::getInstance().getAtom(AtomById(_ids[i]));
+    _atom->UpdateSteps();
+  }
+}
+
+std::vector<atomId_t> MoleCuilder::getIdsFromAtomicInfo(const std::vector<AtomicInfo> &movedatoms)
+{
+  std::vector<atomId_t> ids(movedatoms.size(), (size_t)-1);
+  std::transform(
+      movedatoms.begin(), movedatoms.end(),
+      ids.begin(),
+      boost::bind(&AtomicInfo::getId, _1));
+  return ids;
+}
Index: src/Actions/UndoRedoHelpers.hpp
===================================================================
--- src/Actions/UndoRedoHelpers.hpp	(revision 4424959d82789202040886c380e14457ae068293)
+++ src/Actions/UndoRedoHelpers.hpp	(revision 7e51e12e82c5637d2660d794f1e024fda52a5aa6)
@@ -55,5 +55,5 @@
    * @param movedatoms vector of atomicInfo
    */
-  void SetAtomsFromAtomicInfo(std::vector<AtomicInfo> &movedatoms);
+  void SetAtomsFromAtomicInfo(const std::vector<AtomicInfo> &_movedatoms);
 
   /** Selects all atoms inside the given vector
@@ -61,5 +61,16 @@
    * @param movedatoms vector of atomicInfo
    */
-  void SelectAtomsFromAtomicInfo(std::vector<AtomicInfo> &movedatoms);
+  void SelectAtomsFromAtomicInfo(const std::vector<AtomicInfo> &_movedatoms);
+
+  /** Helper function to allow setting arbitrary atom vectorial information via some
+   * \a setter function.
+   *
+   * @param movedatoms atoms whose info to change
+   * @param MovedToVector vector with old vectorial information
+   */
+  void ResetByFunction(
+      const std::vector<AtomicInfo> &movedatoms,
+      const std::vector<Vector> &MovedToVector,
+      boost::function<void(atom *, const Vector&)> &setter);
 
   /** Sets the atoms whose id is stored in given AtomicInfo in \a movedatoms
@@ -71,4 +82,20 @@
   void ResetAtomPosition(const std::vector<AtomicInfo> &movedatoms, const std::vector<Vector> &MovedToVector);
 
+  /** Sets the atoms whose id is stored in given AtomicInfo in \a movedatoms
+   *  to position in \a MovedToVector.
+   *
+   * @param movedatoms atoms whose position to change
+   * @param VelocityVector vector with old velocities
+   */
+  void ResetAtomVelocity(const std::vector<AtomicInfo> &movedatoms, const std::vector<Vector> &VelocityVector);
+
+  /** Sets the atoms whose id is stored in given AtomicInfo in \a movedatoms
+   *  to position in \a MovedToVector.
+   *
+   * @param movedatoms atoms whose position to change
+   * @param ForceVector vector with old forces
+   */
+  void ResetAtomForce(const std::vector<AtomicInfo> &movedatoms, const std::vector<Vector> &ForceVector);
+
   /** Remove all molecules identified by their ids given in \a ids.
    *
@@ -76,4 +103,33 @@
    */
   void RemoveMoleculesWithAtomsByIds(const std::vector<moleculeId_t> &ids);
+
+  /** Removes the last time step for all \a movedatoms
+   *
+   * @param movedatoms atoms whose last step in time to remove
+   */
+  void removeLastStep(const std::vector<atomId_t> &movedatoms);
+
+  /** Adds another time step to all \a movedatoms.
+   *
+   * Note that the time step is initialized to zero.
+   *
+   * @param _ids atoms whose last step in time to remove
+   */
+  void addNewStep(const std::vector<atomId_t> &_ids);
+
+  /** Adds another time step to all \a movedatoms.
+   *
+   * Note that the time step is initialized to zero. This gives you a chance
+   * to set the time step and call setAtomsFromAtomicInfo() yourself.
+   *
+   * @param _movedatoms atoms whose last step in time to remove
+   */
+  void addNewStep(const std::vector<AtomicInfo> &_movedatoms);
+
+  /** Helper function to extract id information from vector of AtomicInfo.
+   *
+   * @param movedatoms atoms whose ids to extract
+   */
+  std::vector<atomId_t> getIdsFromAtomicInfo(const std::vector<AtomicInfo> &movedatoms);
 }
 
Index: src/Atom/AtomicInfo.cpp
===================================================================
--- src/Atom/AtomicInfo.cpp	(revision 4424959d82789202040886c380e14457ae068293)
+++ src/Atom/AtomicInfo.cpp	(revision 7e51e12e82c5637d2660d794f1e024fda52a5aa6)
@@ -61,4 +61,5 @@
     charge(_atom.getCharge()),
     Velocity(_atom.getAtomicVelocity()),
+    Force(_atom.getAtomicForce()),
     FatherId(_atom.father->getId()),
     MolId(0),
@@ -82,4 +83,5 @@
   _atom.setCharge(charge);
   _atom.setAtomicVelocity(Velocity);
+  _atom.setAtomicForce(Force);
 
   // set old id
@@ -117,4 +119,5 @@
   MolId = AI.MolId;
   Velocity = AI.Velocity;
+  Force = AI.Force;
   Id = AI.Id;
   Nr = AI.Nr;
Index: src/Atom/AtomicInfo.hpp
===================================================================
--- src/Atom/AtomicInfo.hpp	(revision 4424959d82789202040886c380e14457ae068293)
+++ src/Atom/AtomicInfo.hpp	(revision 7e51e12e82c5637d2660d794f1e024fda52a5aa6)
@@ -40,4 +40,5 @@
   double charge;
   Vector Velocity;
+  Vector Force;
   atomId_t FatherId;
   moleculeId_t MolId;
Index: src/Atom/TesselPoint.cpp
===================================================================
--- src/Atom/TesselPoint.cpp	(revision 4424959d82789202040886c380e14457ae068293)
+++ src/Atom/TesselPoint.cpp	(revision 7e51e12e82c5637d2660d794f1e024fda52a5aa6)
@@ -58,4 +58,10 @@
 };
 
+void TesselPoint::removeSteps()
+{
+  ASSERT(0, "TesselPoint::removeSteps() should never be called, TesselPoints don't have trajectories.");
+  AtomInfo::removeTrajectoryStep();
+};
+
 TesselPoint * TesselPoint::getTesselPoint()
 {
Index: src/Atom/TesselPoint.hpp
===================================================================
--- src/Atom/TesselPoint.hpp	(revision 4424959d82789202040886c380e14457ae068293)
+++ src/Atom/TesselPoint.hpp	(revision 7e51e12e82c5637d2660d794f1e024fda52a5aa6)
@@ -39,4 +39,12 @@
   virtual void UpdateSteps();
 
+  /** Pops the last step in all trajectory vectors.
+   *
+   * This allows to decrease all trajectories contained in different classes
+   * by one consistently. This is implemented by the topmost class which calls
+   * the real functions, \sa removeTrajectoryStep(), by all necessary subclasses.
+   */
+  virtual void removeSteps();
+
   /** Getter for this.
    *
Index: src/Atom/atom.cpp
===================================================================
--- src/Atom/atom.cpp	(revision 4424959d82789202040886c380e14457ae068293)
+++ src/Atom/atom.cpp	(revision 7e51e12e82c5637d2660d794f1e024fda52a5aa6)
@@ -100,4 +100,13 @@
   // append to ListOfBonds vector
   BondedParticleInfo::AppendTrajectoryStep();
+}
+
+void atom::removeSteps()
+{
+  LOG(4,"atom::removeSteps() called.");
+  // append to position, velocity and force vector
+  AtomInfo::removeTrajectoryStep();
+  // append to ListOfBonds vector
+  BondedParticleInfo::removeTrajectoryStep();
 }
 
Index: src/Atom/atom.hpp
===================================================================
--- src/Atom/atom.hpp	(revision 4424959d82789202040886c380e14457ae068293)
+++ src/Atom/atom.hpp	(revision 7e51e12e82c5637d2660d794f1e024fda52a5aa6)
@@ -66,4 +66,12 @@
    */
   virtual void UpdateSteps();
+
+  /** Pops the last step in all trajectory vectors.
+   *
+   * This allows to decrease all trajectories contained in different classes
+   * by one consistently. This is implemented by the topmost class which calls
+   * the real functions, \sa removeTrajectoryStep(), by all necessary subclasses.
+   */
+  virtual void removeSteps();
 
   /** Output of a single atom with given numbering.
Index: src/Atom/atom_atominfo.cpp
===================================================================
--- src/Atom/atom_atominfo.cpp	(revision 4424959d82789202040886c380e14457ae068293)
+++ src/Atom/atom_atominfo.cpp	(revision 7e51e12e82c5637d2660d794f1e024fda52a5aa6)
@@ -105,4 +105,16 @@
   AtomicForce.push_back(zeroVec);
   LOG(5,"AtomInfo::AppendTrajectoryStep() called, size is ("
+      << AtomicPosition.size() << ","
+      << AtomicVelocity.size() << ","
+      << AtomicForce.size() << ")");
+}
+
+void AtomInfo::removeTrajectoryStep()
+{
+  NOTIFY(TrajectoryChanged);
+  AtomicPosition.pop_back();
+  AtomicVelocity.pop_back();
+  AtomicForce.pop_back();
+  LOG(5,"AtomInfo::removeTrajectoryStep() called, size is ("
       << AtomicPosition.size() << ","
       << AtomicVelocity.size() << ","
Index: src/Atom/atom_atominfo.hpp
===================================================================
--- src/Atom/atom_atominfo.hpp	(revision 4424959d82789202040886c380e14457ae068293)
+++ src/Atom/atom_atominfo.hpp	(revision 7e51e12e82c5637d2660d794f1e024fda52a5aa6)
@@ -36,4 +36,8 @@
 class RealSpaceMatrix;
 
+namespace MoleCuilder {
+  void removeLastStep(const std::vector<atomId_t> &atoms);
+};
+
 /********************************************** declarations *******************************/
 
@@ -53,4 +57,12 @@
    */
   virtual void UpdateSteps()=0;
+
+  /** Pops the last step in all trajectory vectors.
+   *
+   * This allows to decrease all trajectories contained in different classes
+   * by one consistently. This is implemented by the topmost class which calls
+   * the real functions, \sa removeTrajectoryStep(), by all necessary subclasses.
+   */
+  virtual void removeSteps()=0;
 
   /** DEPRECATED: Getter for element indicated by AtomicElement.
@@ -287,4 +299,9 @@
   void AppendTrajectoryStep();
 
+  /** Function used by this and inheriting classes to decrease the trajectory
+   * vectors by one.
+   */
+  void removeTrajectoryStep();
+
   // make these protected only such that deriving atom class still has full
   // access needed for clone and alike
Index: src/Atom/atom_bondedparticleinfo.cpp
===================================================================
--- src/Atom/atom_bondedparticleinfo.cpp	(revision 4424959d82789202040886c380e14457ae068293)
+++ src/Atom/atom_bondedparticleinfo.cpp	(revision 7e51e12e82c5637d2660d794f1e024fda52a5aa6)
@@ -63,4 +63,10 @@
 }
 
+void BondedParticleInfo::removeTrajectoryStep()
+{
+  ListOfBonds.pop_back();
+  LOG(5,"BondedParticleInfo::removeTrajectoryStep() called, size is " << ListOfBonds.size());
+}
+
 const BondList& BondedParticleInfo::getListOfBonds() const
 {
Index: src/Atom/atom_bondedparticleinfo.hpp
===================================================================
--- src/Atom/atom_bondedparticleinfo.hpp	(revision 4424959d82789202040886c380e14457ae068293)
+++ src/Atom/atom_bondedparticleinfo.hpp	(revision 7e51e12e82c5637d2660d794f1e024fda52a5aa6)
@@ -89,4 +89,9 @@
   void AppendTrajectoryStep();
 
+  /** Function used by this and inheriting classes to reduce the ListOfBonds
+   * vector by one.
+   */
+  void removeTrajectoryStep();
+
   std::vector<BondList> ListOfBonds; //!< list of all bonds
   static BondList emptyList;  //!< empty list to return when step is not present
