Index: src/Actions/SelectionAction/Molecules/PopMoleculesAction.cpp
===================================================================
--- src/Actions/SelectionAction/Molecules/PopMoleculesAction.cpp	(revision 066442d357f0a016de2922eff675320398a5ba17)
+++ src/Actions/SelectionAction/Molecules/PopMoleculesAction.cpp	(revision 066442d357f0a016de2922eff675320398a5ba17)
@@ -0,0 +1,88 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2014 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * PopMoleculesAction.cpp
+ *
+ *  Created on: Dec 19, 2014
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include <boost/bind.hpp>
+#include "CodePatterns/Log.hpp"
+#include "molecule.hpp"
+#include "World.hpp"
+
+#include "PopMoleculesAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "PopMoleculesAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+ActionState::ptr SelectionPopMoleculesAction::performCall() {
+  // create undo state
+  const std::vector<molecule *> selected_mols = World::getInstance().getSelectedMolecules();
+  std::vector<moleculeId_t> selected_molids(selected_mols.size(), (moleculeId_t)-1);
+  std::transform(
+      selected_mols.begin(), selected_mols.end(),
+      selected_molids.begin(),
+      boost::bind(&molecule::getId, _1));
+  LOG(1, "Popping molecule selection.");
+  World::getInstance().popMoleculeSelection();
+  return ActionState::ptr(new SelectionPopMoleculesState(selected_molids, params));
+}
+
+ActionState::ptr SelectionPopMoleculesAction::performUndo(ActionState::ptr _state) {
+  SelectionPopMoleculesState *state = static_cast<SelectionPopMoleculesState *>(_state.get());
+  LOG(1, "Pushing molecule selection.");
+  World::getInstance().pushMoleculeSelection();
+  // re-create old selection
+  for(std::vector<moleculeId_t>::const_iterator iter = state->selected_molids.begin();
+      iter != state->selected_molids.end(); ++iter)
+    World::getInstance().selectMolecule(*iter);
+
+  return ActionState::ptr(_state);
+}
+
+ActionState::ptr SelectionPopMoleculesAction::performRedo(ActionState::ptr _state){
+  LOG(1, "Popping molecule selection.");
+  World::getInstance().popMoleculeSelection();
+  return ActionState::ptr(_state);
+}
+
+bool SelectionPopMoleculesAction::canUndo() {
+  return true;
+}
+
+bool SelectionPopMoleculesAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/Molecules/PopMoleculesAction.def
===================================================================
--- src/Actions/SelectionAction/Molecules/PopMoleculesAction.def	(revision 066442d357f0a016de2922eff675320398a5ba17)
+++ src/Actions/SelectionAction/Molecules/PopMoleculesAction.def	(revision 066442d357f0a016de2922eff675320398a5ba17)
@@ -0,0 +1,35 @@
+/*
+ * PopMoleculesAction.def
+ *
+ *  Created on: Dec 19, 2014
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include <vector>
+#include "types.hpp"
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
+#undef paramtypes
+#undef paramtokens
+#undef paramdescriptions
+#undef paramdefaults
+#undef paramreferences
+#undef paramvalids
+
+#define statetypes (std::vector<moleculeId_t>)
+#define statereferences (selected_molids)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define MENUNAME "selection"
+#define MENUPOSITION 1
+#define ACTIONNAME PopMolecules
+#define TOKEN "pop-molecule-selection"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "push the molecule selection to a stack"
+#undef SHORTFORM
Index: src/Actions/SelectionAction/Molecules/PopMoleculesAction.hpp
===================================================================
--- src/Actions/SelectionAction/Molecules/PopMoleculesAction.hpp	(revision 066442d357f0a016de2922eff675320398a5ba17)
+++ src/Actions/SelectionAction/Molecules/PopMoleculesAction.hpp	(revision 066442d357f0a016de2922eff675320398a5ba17)
@@ -0,0 +1,22 @@
+/*
+ * PopMoleculesAction.hpp
+ *
+ *  Created on: Dec 19, 2014
+ *      Author: heber
+ */
+
+#ifndef POPMOLECULESACTION_HPP_
+#define POPMOLECULESACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "PopMoleculesAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* POPMOLECULESACTION_HPP_ */
Index: src/Actions/SelectionAction/Molecules/PushMoleculesAction.cpp
===================================================================
--- src/Actions/SelectionAction/Molecules/PushMoleculesAction.cpp	(revision 066442d357f0a016de2922eff675320398a5ba17)
+++ src/Actions/SelectionAction/Molecules/PushMoleculesAction.cpp	(revision 066442d357f0a016de2922eff675320398a5ba17)
@@ -0,0 +1,73 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2014 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * PushMoleculesAction.cpp
+ *
+ *  Created on: Dec 19, 2014
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "CodePatterns/Log.hpp"
+#include "World.hpp"
+
+#include "PushMoleculesAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "PushMoleculesAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+ActionState::ptr SelectionPushMoleculesAction::performCall() {
+  LOG(1, "Pushing molecule selection.");
+  World::getInstance().pushMoleculeSelection();
+
+  return Action::success;
+}
+
+ActionState::ptr SelectionPushMoleculesAction::performUndo(ActionState::ptr _state) {
+  LOG(1, "Pushing molecule selection.");
+  World::getInstance().popMoleculeSelection();
+
+  return Action::success;
+}
+
+ActionState::ptr SelectionPushMoleculesAction::performRedo(ActionState::ptr _state){
+  return performCall();
+}
+
+bool SelectionPushMoleculesAction::canUndo() {
+  return true;
+}
+
+bool SelectionPushMoleculesAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/Molecules/PushMoleculesAction.def
===================================================================
--- src/Actions/SelectionAction/Molecules/PushMoleculesAction.def	(revision 066442d357f0a016de2922eff675320398a5ba17)
+++ src/Actions/SelectionAction/Molecules/PushMoleculesAction.def	(revision 066442d357f0a016de2922eff675320398a5ba17)
@@ -0,0 +1,33 @@
+/*
+ * PushMoleculesAction.def
+ *
+ *  Created on: Dec 19, 2014
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
+#undef paramtypes
+#undef paramtokens
+#undef paramdescriptions
+#undef paramdefaults
+#undef paramreferences
+#undef paramvalids
+
+#undef statetypes
+#undef statereferences
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define MENUNAME "selection"
+#define MENUPOSITION 1
+#define ACTIONNAME PushMolecules
+#define TOKEN "push-molecule-selection"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "push the molecule selection from a stack"
+#undef SHORTFORM
Index: src/Actions/SelectionAction/Molecules/PushMoleculesAction.hpp
===================================================================
--- src/Actions/SelectionAction/Molecules/PushMoleculesAction.hpp	(revision 066442d357f0a016de2922eff675320398a5ba17)
+++ src/Actions/SelectionAction/Molecules/PushMoleculesAction.hpp	(revision 066442d357f0a016de2922eff675320398a5ba17)
@@ -0,0 +1,22 @@
+/*
+ * PushMoleculesAction.hpp
+ *
+ *  Created on: Dec 19, 2014
+ *      Author: heber
+ */
+
+#ifndef PUSHMOLECULESACTION_HPP_
+#define PUSHMOLECULESACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "PushMoleculesAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* PUSHMOLECULESACTION_HPP_ */
