Index: src/Actions/MoleculeAction/LoadAction.cpp
===================================================================
--- src/Actions/MoleculeAction/LoadAction.cpp	(revision 5e2f80b94564cd7797be678d694bf8d3012bd825)
+++ src/Actions/MoleculeAction/LoadAction.cpp	(revision 78d5b295fa5c42519eac5454fe4513a96fe11df3)
@@ -22,5 +22,7 @@
 #include "CodePatterns/Log.hpp"
 #include "CodePatterns/Verbose.hpp"
+#include "Descriptors/MoleculeIdDescriptor.hpp"
 #include "Parser/FormatParserStorage.hpp"
+#include "Parser/FormatParser_Parameters.hpp"
 #include "molecule.hpp"
 #include "World.hpp"
@@ -45,5 +47,5 @@
   if (!boost::filesystem::exists(params.filename)) {
     DoLog(1) && (Log() << Verbose(1) << "Specified input file " << params.filename << " not found." << endl);
-    // DONT FAIL: it's just empty and we use the name. // return Action::failure;
+    return Action::failure;
   } else {
     DoLog(1) && (Log() << Verbose(1) << "Specified input file found, parsing ... ");
@@ -66,4 +68,12 @@
     }
 
+    // get undo state for parser
+    enum ParserTypes type = FormatParserStorage::getInstance().getTypeFromSuffix(FilenameSuffix);
+    FormatParser_Parameters *ParserParams = FormatParserStorage::getInstance().get(type).parameters;
+    if (ParserParams != NULL)
+      ParserParams = ParserParams->clone();
+    else
+      ParserParams = NULL;
+
     // parse the file
     boost::filesystem::ifstream input;
@@ -76,20 +86,55 @@
     (*iter)->SetNameFromFilename(FilenamePrefix.c_str());
     DoLog(0) && (Log() << Verbose(0) << "Chemical formula is " << (*iter)->getFormula() << std::endl);
+
+    return Action::state_ptr(
+        new MoleculeLoadState((*iter)->getId(),FilenamePrefix,FilenameSuffix,boost::shared_ptr<FormatParser_Parameters>(ParserParams),params)
+    );
   }
-  return Action::success;
 }
 
 Action::state_ptr MoleculeLoadAction::performUndo(Action::state_ptr _state) {
-//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
+  MoleculeLoadState *state = assert_cast<MoleculeLoadState*>(_state.get());
 
-  return Action::failure;
-//  string newName = state->mol->getName();
-//  state->mol->setName(state->lastName);
-//
-//  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
+  // remove loaded molecule and its atoms
+  molecule *mol = World::getInstance().getMolecule(MoleculeById(state->molId));
+  for(molecule::iterator iter = mol->begin(); !mol->empty(); iter = mol->begin())
+    World::getInstance().destroyAtom(*iter);
+  //World::getInstance().destroyMolecule(mol);
+
+  // undo changes to FormatParser
+  enum ParserTypes type = FormatParserStorage::getInstance().getTypeFromSuffix(state->FilenameSuffix);
+  FormatParser_Parameters *ParserParams = FormatParserStorage::getInstance().get(type).parameters;
+  if (ParserParams != NULL)
+    ParserParams->makeClone(*state->ParserParameters);
+
+  return Action::state_ptr(_state);
 }
 
 Action::state_ptr MoleculeLoadAction::performRedo(Action::state_ptr _state){
-  return Action::failure;
+  MoleculeLoadState *state = assert_cast<MoleculeLoadState*>(_state.get());
+
+  // get undo state for parser
+  enum ParserTypes type = FormatParserStorage::getInstance().getTypeFromSuffix(state->FilenameSuffix);
+  FormatParser_Parameters *ParserParams = FormatParserStorage::getInstance().get(type).parameters;
+  if (ParserParams != NULL)
+    ParserParams = ParserParams->clone();
+  else
+    ParserParams = NULL;
+
+  // parse the file
+  boost::filesystem::ifstream input;
+  input.open(state->params.filename);
+  FormatParserStorage::getInstance().load(input, state->FilenameSuffix);
+  input.close();
+
+  // set file name of last molecule
+  MoleculeList::const_reverse_iterator iter = World::getInstance().getMolecules()->ListOfMolecules.rbegin();
+  (*iter)->SetNameFromFilename(state->FilenamePrefix.c_str());
+  (*iter)->setId(state->molId);
+  DoLog(0) && (Log() << Verbose(0) << "Chemical formula is " << (*iter)->getFormula() << std::endl);
+
+  return Action::state_ptr(
+      new MoleculeLoadState((*iter)->getId(),state->FilenamePrefix,state->FilenameSuffix,boost::shared_ptr<FormatParser_Parameters>(ParserParams),params)
+  );
 }
 
Index: src/Actions/MoleculeAction/LoadAction.def
===================================================================
--- src/Actions/MoleculeAction/LoadAction.def	(revision 5e2f80b94564cd7797be678d694bf8d3012bd825)
+++ src/Actions/MoleculeAction/LoadAction.def	(revision 78d5b295fa5c42519eac5454fe4513a96fe11df3)
@@ -7,5 +7,7 @@
 
 // all includes and forward declarations necessary for non-integral types below
+#include "Parser/FormatParser_Parameters.hpp"
 
+#include <boost/shared_ptr.hpp>
 
 // i.e. there is an integer with variable name Z that can be found in
@@ -18,6 +20,6 @@
 #define paramreferences (filename)
 
-#undef statetypes
-#undef statereferences
+#define statetypes (moleculeId_t)(std::string)(std::string)(boost::shared_ptr<FormatParser_Parameters>)
+#define statereferences (molId)(FilenamePrefix)(FilenameSuffix)(ParserParameters)
 
 // some defines for all the names, you may use ACTION, STATE and PARAMS
