Index: src/Actions/WorldAction/AddEmptyBoundaryAction.cpp
===================================================================
--- src/Actions/WorldAction/AddEmptyBoundaryAction.cpp	(revision 61ff0550acb166bb41ba1ba619e3778004377a74)
+++ src/Actions/WorldAction/AddEmptyBoundaryAction.cpp	(revision 9cd6bf995419cdfd5a5058be82ebeb15acdb539c)
@@ -18,8 +18,15 @@
 #endif
 
+// include headers that implement a archive in simple text format
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+#include "boost/serialization/vector.hpp"
+
 #include "CodePatterns/MemDebug.hpp"
 
 #include "atom.hpp"
+#include "Box.hpp"
 #include "CodePatterns/Log.hpp"
+#include "LinearAlgebra/MatrixContent.hpp"
 #include "LinearAlgebra/RealSpaceMatrix.hpp"
 #include "LinearAlgebra/Vector.hpp"
@@ -46,8 +53,14 @@
   getParametersfromValueStorage();
 
+  // create undo domain
+  std::stringstream undostream;
+  boost::archive::text_oarchive oa(undostream);
+  const RealSpaceMatrix &matrix = World::getInstance().getDomain().getM();
+  oa << matrix;
+
   // get maximum and minimum
-  vector<atom *> AllAtoms = World::getInstance().getAllAtoms();
+  std::vector<atom *> AllAtoms = World::getInstance().getAllAtoms();
   ASSERT(AllAtoms.size() > 0, "There must be atoms present for AddingEmptyBoundary.");
-  vector<atom *>::iterator AtomRunner = AllAtoms.begin();
+  std::vector<atom *>::iterator AtomRunner = AllAtoms.begin();
   Min = (*AtomRunner)->getPosition();
   Max = (*AtomRunner)->getPosition();
@@ -73,5 +86,7 @@
   // translate all atoms, such that Min is aty (0,0,0)
   AtomRunner = AllAtoms.begin();
-  for (; AtomRunner != AllAtoms.end(); ++AtomRunner)
+  for (std::vector<atom *>::iterator AtomRunner = AllAtoms.begin();
+      AtomRunner != AllAtoms.end();
+      ++AtomRunner)
     *(*AtomRunner) -= Min - params.boundary;
 
@@ -79,27 +94,63 @@
   LOG(0, "Box domain is now " << World::getInstance().getDomain().getM());
 
-  return Action::success;
+  // create undo state
+  WorldAddEmptyBoundaryState *UndoState =
+      new WorldAddEmptyBoundaryState(
+          undostream.str(),
+          World::getInstance().getDomain().getM(),
+          Min,
+          params
+          );
+
+  return Action::state_ptr(UndoState);
 }
 
 Action::state_ptr WorldAddEmptyBoundaryAction::performUndo(Action::state_ptr _state) {
-//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+  WorldAddEmptyBoundaryState *state = assert_cast<WorldAddEmptyBoundaryState*>(_state.get());
 
-  return Action::failure;
-//  string newName = state->mol->getName();
-//  state->mol->setName(state->lastName);
-//
-//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+  // restore domain
+  RealSpaceMatrix matrix;
+  std::stringstream undostream(state->undostring);
+  boost::archive::text_iarchive ia(undostream);
+  ia >> matrix;
+  World::getInstance().setDomain(matrix);
+
+  // give final box size
+  LOG(0, "Box domain restored to " << World::getInstance().getDomain().getM());
+
+  // restore atoms
+  std::vector<atom *> AllAtoms = World::getInstance().getAllAtoms();
+  for (std::vector<atom *>::iterator AtomRunner = AllAtoms.begin();
+      AtomRunner != AllAtoms.end();
+      ++AtomRunner)
+    *(*AtomRunner) += state->Min - state->params.boundary;
+
+  return Action::state_ptr(_state);
 }
 
 Action::state_ptr WorldAddEmptyBoundaryAction::performRedo(Action::state_ptr _state){
-  return Action::failure;
+  WorldAddEmptyBoundaryState *state = assert_cast<WorldAddEmptyBoundaryState*>(_state.get());
+
+  World::getInstance().setDomain(state->newdomain);
+
+  // give final box size
+  LOG(0, "Box domain is again " << World::getInstance().getDomain().getM());
+
+  // shift atoms
+  std::vector<atom *> AllAtoms = World::getInstance().getAllAtoms();
+  for (std::vector<atom *>::iterator AtomRunner = AllAtoms.begin();
+      AtomRunner != AllAtoms.end();
+      ++AtomRunner)
+    *(*AtomRunner) -= state->Min - state->params.boundary;
+
+  return Action::state_ptr(_state);
 }
 
 bool WorldAddEmptyBoundaryAction::canUndo() {
-  return false;
+  return true;
 }
 
 bool WorldAddEmptyBoundaryAction::shouldUndo() {
-  return false;
+  return true;
 }
 /** =========== end of function ====================== */
Index: src/Actions/WorldAction/AddEmptyBoundaryAction.def
===================================================================
--- src/Actions/WorldAction/AddEmptyBoundaryAction.def	(revision 61ff0550acb166bb41ba1ba619e3778004377a74)
+++ src/Actions/WorldAction/AddEmptyBoundaryAction.def	(revision 9cd6bf995419cdfd5a5058be82ebeb15acdb539c)
@@ -8,4 +8,5 @@
 // all includes and forward declarations necessary for non-integral types below
 #include "Actions/Values.hpp"
+#include "LinearAlgebra/RealSpaceMatrix.hpp"
 #include "LinearAlgebra/Vector.hpp"
 
@@ -19,6 +20,6 @@
 #define paramreferences (boundary)
 
-#undef statetypes
-#undef statereferences
+#define statetypes (std::string)(RealSpaceMatrix)(Vector)
+#define statereferences (undostring)(newdomain)(Min)
 
 // some defines for all the names, you may use ACTION, STATE and PARAMS
