Index: src/Actions/CommandAction/BondLengthTableAction.cpp
===================================================================
--- src/Actions/CommandAction/BondLengthTableAction.cpp	(revision 3bdb6de29d0b7776bda5bfd425ac0a815e8a8d88)
+++ src/Actions/CommandAction/BondLengthTableAction.cpp	(revision 93d78e8de4fa69e04316803de231b7406107b2d9)
@@ -17,4 +17,8 @@
 #include <config.h>
 #endif
+
+// include headers that implement a archive in simple text format
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
 
 #include "CodePatterns/MemDebug.hpp"
@@ -44,8 +48,17 @@
 
   DoLog(0) && (Log() << Verbose(0) << "Using " << params.BondGraphFileName << " as bond length table." << endl);
-  config *configuration = World::getInstance().getConfig();
-  BondGraph *OldBG = World::getInstance().getBondGraph();
+  BondGraph *&BG = World::getInstance().getBondGraph();
 
-  BondGraph *BG = new BondGraph(configuration->GetIsAngstroem());
+  // create undo state
+  std::stringstream undostream;
+  boost::archive::text_oarchive oa(undostream);
+  oa << BG;
+  CommandBondLengthTableState *UndoState =
+      new CommandBondLengthTableState(
+          undostream.str(),
+          params
+      );
+
+  BG->CleanupBondLengthTable();
   if ((!params.BondGraphFileName.empty())
       && boost::filesystem::exists(params.BondGraphFileName)) {
@@ -54,16 +67,18 @@
       DoLog(0) && (Log() << Verbose(0) << "Bond length table parsed successfully." << endl);
       input.close();
-      CommandBondLengthTableState *state = new CommandBondLengthTableState(*OldBG, params);
-      World::getInstance().setBondGraph(BG);  // Changes OldBG, hence have to copy beforehand
-      return Action::state_ptr(state);
+      return Action::state_ptr(UndoState);
     } else {
       DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table parsing failed." << endl);
       input.close();
-      return Action::failure;
     }
   } else {
     DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl);
-    return Action::failure;
   }
+  // recover bond graph
+  boost::archive::text_iarchive ia(undostream);
+  delete BG;
+  ia >> BG;
+  delete UndoState;
+  return Action::failure;
 }
 
@@ -71,9 +86,11 @@
   CommandBondLengthTableState *state = assert_cast<CommandBondLengthTableState*>(_state.get());
 
-  BondGraph *OldBG = World::getInstance().getBondGraph();
-  CommandBondLengthTableState *restate = new CommandBondLengthTableState(*OldBG, params);
-  World::getInstance().setBondGraph(new BondGraph(state->OldBG));  // Changes OldBG, hence have to copy beforehand
+  BondGraph *BG;
+  std::stringstream undostream(state->undostring);
+  boost::archive::text_iarchive ia(undostream);
+  ia >> BG;
+  World::getInstance().setBondGraph(BG);
 
-  return Action::state_ptr(restate);
+  return Action::state_ptr(_state);
 }
 
@@ -81,17 +98,21 @@
   CommandBondLengthTableState *state = assert_cast<CommandBondLengthTableState*>(_state.get());
 
-  BondGraph *OldBG = World::getInstance().getBondGraph();
-  CommandBondLengthTableState *restate = new CommandBondLengthTableState(*OldBG, params);
-  World::getInstance().setBondGraph(new BondGraph(state->OldBG));  // Changes OldBG, hence have to copy beforehand
+  BondGraph *&BG = World::getInstance().getBondGraph();
+  BG->CleanupBondLengthTable();
+  std::ifstream input(state->params.BondGraphFileName.string().c_str());
+  if ((input.good()) && (BG->LoadBondLengthTable(input))) {
+    DoLog(0) && (Log() << Verbose(0) << "Bond length table parsed successfully." << endl);
+    input.close();
+  }
 
-  return Action::state_ptr(restate);
+  return Action::state_ptr(_state);
 }
 
 bool CommandBondLengthTableAction::canUndo() {
-  return false;
+  return true;
 }
 
 bool CommandBondLengthTableAction::shouldUndo() {
-  return false;
+  return true;
 }
 /** =========== end of function ====================== */
Index: src/Actions/CommandAction/BondLengthTableAction.def
===================================================================
--- src/Actions/CommandAction/BondLengthTableAction.def	(revision 3bdb6de29d0b7776bda5bfd425ac0a815e8a8d88)
+++ src/Actions/CommandAction/BondLengthTableAction.def	(revision 93d78e8de4fa69e04316803de231b7406107b2d9)
@@ -19,6 +19,6 @@
 #define paramreferences (BondGraphFileName)
 
-#define statetypes (BondGraph)
-#define statereferences (OldBG)
+#define statetypes (std::string)
+#define statereferences (undostring)
 
 // some defines for all the names, you may use ACTION, STATE and PARAMS
