Index: src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp
===================================================================
--- src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp	(revision 5e17bf3ec7daf123299bac22362c704fe9e0a1eb)
+++ src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp	(revision 137845c39a5abda95f0873eb220a9c35f1b62281)
@@ -35,6 +35,9 @@
 //#include "CodePatterns/MemDebug.hpp"
 
+#include "CodePatterns/Assert.hpp"
 #include "CodePatterns/Log.hpp"
-#include "CodePatterns/Verbose.hpp"
+
+#include "Actions/UndoRedoHelpers.hpp"
+#include "Atom/AtomicInfo.hpp"
 #include "LinearAlgebra/Line.hpp"
 #include "LinearAlgebra/RealSpaceMatrix.hpp"
@@ -58,31 +61,54 @@
   molecule *mol = NULL;
 
+  std::vector<AtomicInfo> UndoInfo;
   for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) {
     mol = iter->second;
     LOG(0, "Converting to prinicipal axis system.");
 
-    RealSpaceMatrix InertiaTensor = mol->getInertiaTensor();
+    // gather undo information: store position of all atoms of molecule
+    UndoInfo.reserve(UndoInfo.size()+mol->size());
+    {
+      for (molecule::const_iterator iter = const_cast<molecule const *>(mol)->begin();
+          iter != const_cast<molecule const *>(mol)->end();
+          ++iter) {
+        const atom * const Walker = *iter;
+        UndoInfo.push_back(AtomicInfo(*Walker));
+      }
+    }
 
+    // rotate
+//    RealSpaceMatrix InertiaTensor = mol->getInertiaTensor();
     mol->RotateToPrincipalAxisSystem(params.Axis.get());
 
     // summing anew for debugging (resulting matrix has to be diagonal!)
-    InertiaTensor = mol->getInertiaTensor();
+    RealSpaceMatrix InertiaTensor = mol->getInertiaTensor();
   }
-  return Action::success;
+
+  MoleculeRotateToPrincipalAxisSystemState *UndoState =
+      new MoleculeRotateToPrincipalAxisSystemState(UndoInfo, params);
+  return ActionState::ptr(UndoState);
 }
 
 ActionState::ptr MoleculeRotateToPrincipalAxisSystemAction::performUndo(ActionState::ptr _state) {
-//  MoleculeRotateToPrincipalAxisSystemState *state = assert_cast<MoleculeRotateToPrincipalAxisSystemState*>(_state.get());
+  MoleculeRotateToPrincipalAxisSystemState *state =
+      assert_cast<MoleculeRotateToPrincipalAxisSystemState*>(_state.get());
 
-//  string newName = state->mol->getName();
-//  state->mol->setName(state->lastName);
+  // set stored old state
+  SetAtomsFromAtomicInfo(state->undoinfo);
 
-  STATUS("Undo of MoleculeRotateToPrincipalAxisSystemAction not implemented.");
-  return Action::failure;
+  return ActionState::ptr(_state);
 }
 
 ActionState::ptr MoleculeRotateToPrincipalAxisSystemAction::performRedo(ActionState::ptr _state){
-  STATUS("Redo of MoleculeRotateToPrincipalAxisSystemAction not implemented.");
-  return Action::failure;
+  MoleculeRotateToPrincipalAxisSystemState *state =
+      assert_cast<MoleculeRotateToPrincipalAxisSystemState*>(_state.get());
+
+  for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection();
+      iter != World::getInstance().endMoleculeSelection(); ++iter) {
+    molecule * const mol = iter->second;
+    mol->RotateToPrincipalAxisSystem(state->params.Axis.get());
+  }
+
+  return ActionState::ptr(_state);
 }
 
Index: src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.def
===================================================================
--- src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.def	(revision 5e17bf3ec7daf123299bac22362c704fe9e0a1eb)
+++ src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.def	(revision 137845c39a5abda95f0873eb220a9c35f1b62281)
@@ -7,5 +7,8 @@
 
 // all includes and forward declarations necessary for non-integral types below
+#include <vector>
+
 #include "Actions/Values.hpp"
+#include "Atom/AtomicInfo.hpp"
 #include "LinearAlgebra/Vector.hpp"
 
@@ -23,6 +26,6 @@
 (VectorNotZeroValidator())
 
-#undef statetypes
-#undef statereferences
+#define statetypes (std::vector<AtomicInfo>)
+#define statereferences (undoinfo)
 
 // some defines for all the names, you may use ACTION, STATE and PARAMS
