Index: src/Actions/GlobalListOfActions.hpp
===================================================================
--- src/Actions/GlobalListOfActions.hpp	(revision cad38353d3b80b389bc34215a1350cc486705ef7)
+++ src/Actions/GlobalListOfActions.hpp	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -127,4 +127,6 @@
   (SelectionNotMoleculeByOrder) \
   (SelectionNotShapeByName) \
+  (SelectionPopAtoms) \
+  (SelectionPushAtoms) \
   (SelectionShapeByName) \
   (ShapeCombineShapes) \
Index: src/Actions/GraphAction/SubgraphDissectionAction.cpp
===================================================================
--- src/Actions/GraphAction/SubgraphDissectionAction.cpp	(revision cad38353d3b80b389bc34215a1350cc486705ef7)
+++ src/Actions/GraphAction/SubgraphDissectionAction.cpp	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -42,4 +42,7 @@
 #include "Actions/GraphAction/UpdateMoleculesAction.hpp"
 #include "Actions/GraphAction/SubgraphDissectionAction.hpp"
+#include "Actions/SelectionAction/Atoms/PushAtomsAction.hpp"
+#include "Actions/SelectionAction/Atoms/PopAtomsAction.hpp"
+#include "Actions/SelectionAction/Atoms/AllAtomsAction.hpp"
 #include "Actions/ActionQueue.hpp"
 #include "Actions/ActionRegistry.hpp"
@@ -60,8 +63,10 @@
 void GraphSubgraphDissectionAction::prepare(ActionRegistry &AR)
 {
+  actions.addAction(AR.getActionByName(std::string("push-atom-selection")));
   actions.addAction(AR.getActionByName(std::string("select-all-atoms")));
   actions.addAction(AR.getActionByName(std::string("destroy-adjacency")));
   actions.addAction(AR.getActionByName(std::string("create-adjacency")));
   actions.addAction(AR.getActionByName(std::string("update-molecules")));
+  actions.addAction(AR.getActionByName(std::string("pop-atom-selection")));
   isPrepared = true;
 }
@@ -74,19 +79,6 @@
 }
 
-void reselectAtoms(const std::vector<atom *> &selected_atoms)
-{
-  World::getInstance().clearAtomSelection();
-  for (std::vector<atom *>::const_iterator iter = selected_atoms.begin();
-      iter != selected_atoms.end();
-      ++iter)
-    World::getInstance().selectAtom(*iter);
-}
-
 ActionState::ptr GraphSubgraphDissectionAction::performCall(){
-  // we need to "emulate" that all atoms have been selected without destroying
-  // current selection
-  const std::vector<atom *> selected_atoms = World::getInstance().getSelectedAtoms();
   ActionState::ptr state(MakroAction::performCall());
-  reselectAtoms(selected_atoms);
 
   return state;
@@ -94,9 +86,5 @@
 
 ActionState::ptr GraphSubgraphDissectionAction::performUndo(ActionState::ptr _state) {
-  // we need to "emulate" that all atoms have been selected without destroying
-  // current selection
-  const std::vector<atom *> selected_atoms = World::getInstance().getSelectedAtoms();
   ActionState::ptr state(MakroAction::performUndo(_state));
-  reselectAtoms(selected_atoms);
 
   return state;
@@ -104,9 +92,5 @@
 
 ActionState::ptr GraphSubgraphDissectionAction::performRedo(ActionState::ptr _state){
-  // we need to "emulate" that all atoms have been selected without destroying
-  // current selection
-  const std::vector<atom *> selected_atoms = World::getInstance().getSelectedAtoms();
   ActionState::ptr state(MakroAction::performRedo(_state));
-  reselectAtoms(selected_atoms);
 
   return state;
Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision cad38353d3b80b389bc34215a1350cc486705ef7)
+++ src/Actions/Makefile.am	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -415,5 +415,7 @@
   Actions/SelectionAction/Atoms/NotAtomByElementAction.cpp \
   Actions/SelectionAction/Atoms/NotAtomByIdAction.cpp \
-  Actions/SelectionAction/Atoms/NotAtomByOrderAction.cpp
+  Actions/SelectionAction/Atoms/NotAtomByOrderAction.cpp \
+  Actions/SelectionAction/Atoms/PopAtomsAction.cpp \
+  Actions/SelectionAction/Atoms/PushAtomsAction.cpp
 SELECTIONATOMACTIONHEADER = \
   Actions/SelectionAction/Atoms/AllAtomsAction.hpp \
@@ -430,5 +432,7 @@
   Actions/SelectionAction/Atoms/NotAtomByElementAction.hpp \
   Actions/SelectionAction/Atoms/NotAtomByIdAction.hpp \
-  Actions/SelectionAction/Atoms/NotAtomByOrderAction.hpp
+  Actions/SelectionAction/Atoms/NotAtomByOrderAction.hpp \
+  Actions/SelectionAction/Atoms/PopAtomsAction.hpp \
+  Actions/SelectionAction/Atoms/PushAtomsAction.hpp
 SELECTIONATOMACTIONDEFS = \
   Actions/SelectionAction/Atoms/AllAtomsAction.def \
@@ -445,5 +449,7 @@
   Actions/SelectionAction/Atoms/NotAtomByElementAction.def \
   Actions/SelectionAction/Atoms/NotAtomByIdAction.def \
-  Actions/SelectionAction/Atoms/NotAtomByOrderAction.def
+  Actions/SelectionAction/Atoms/NotAtomByOrderAction.def \
+  Actions/SelectionAction/Atoms/PopAtomsAction.def \
+  Actions/SelectionAction/Atoms/PushAtomsAction.def
 
 SELECTIONMOLECULEACTIONSOURCE = \
Index: src/Actions/SelectionAction/Atoms/PopAtomsAction.cpp
===================================================================
--- src/Actions/SelectionAction/Atoms/PopAtomsAction.cpp	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ src/Actions/SelectionAction/Atoms/PopAtomsAction.cpp	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,90 @@
+/*
+ * 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/>.
+ */
+
+/*
+ * PopAtomsAction.cpp
+ *
+ *  Created on: Dec 14, 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 "Atom/atom.hpp"
+#include "World.hpp"
+
+#include "PopAtomsAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "PopAtomsAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+ActionState::ptr SelectionPopAtomsAction::performCall() {
+  // create undo state
+  const std::vector<atom *> selected_atoms = World::getInstance().getSelectedAtoms();
+  std::vector<atomId_t> selected_atomids(selected_atoms.size(), (atomId_t)-1);
+  std::transform(
+      selected_atoms.begin(), selected_atoms.end(),
+      selected_atomids.begin(),
+      boost::bind(&atom::getId, _1));
+  LOG(1, "Popping atom selection.");
+  World::getInstance().popAtomSelection();
+  return ActionState::ptr(new SelectionPopAtomsState(selected_atomids, params));
+}
+
+ActionState::ptr SelectionPopAtomsAction::performUndo(ActionState::ptr _state) {
+  SelectionPopAtomsState *state = static_cast<SelectionPopAtomsState *>(_state.get());
+  LOG(1, "Popping atom selection.");
+  World::getInstance().pushAtomSelection();
+
+  // and re-create present selection
+  for(std::vector<atomId_t>::const_iterator iter = state->selected_atomids.begin();
+      iter != state->selected_atomids.end(); ++iter)
+    World::getInstance().selectAtom(*iter);
+
+  return ActionState::ptr(_state);
+}
+
+ActionState::ptr SelectionPopAtomsAction::performRedo(ActionState::ptr _state){
+  LOG(1, "Popping atom selection.");
+  World::getInstance().popAtomSelection();
+
+  return ActionState::ptr(_state);
+}
+
+bool SelectionPopAtomsAction::canUndo() {
+  return true;
+}
+
+bool SelectionPopAtomsAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/Atoms/PopAtomsAction.def
===================================================================
--- src/Actions/SelectionAction/Atoms/PopAtomsAction.def	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ src/Actions/SelectionAction/Atoms/PopAtomsAction.def	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,35 @@
+/*
+ * PopAtomsAction.def
+ *
+ *  Created on: Dec 14, 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<atomId_t>)
+#define statereferences (selected_atomids)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define MENUNAME "selection"
+#define MENUPOSITION 1
+#define ACTIONNAME PopAtoms
+#define TOKEN "pop-atom-selection"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "push the atom selection to a stack"
+#undef SHORTFORM
Index: src/Actions/SelectionAction/Atoms/PopAtomsAction.hpp
===================================================================
--- src/Actions/SelectionAction/Atoms/PopAtomsAction.hpp	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ src/Actions/SelectionAction/Atoms/PopAtomsAction.hpp	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,22 @@
+/*
+ * PopAtomsAction.hpp
+ *
+ *  Created on: Dec 14, 2014
+ *      Author: heber
+ */
+
+#ifndef POPATOMSACTION_HPP_
+#define POPATOMSACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "PopAtomsAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* POPATOMSACTION_HPP_ */
Index: src/Actions/SelectionAction/Atoms/PushAtomsAction.cpp
===================================================================
--- src/Actions/SelectionAction/Atoms/PushAtomsAction.cpp	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ src/Actions/SelectionAction/Atoms/PushAtomsAction.cpp	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -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/>.
+ */
+
+/*
+ * PushAtomsAction.cpp
+ *
+ *  Created on: Dec 14, 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 "PushAtomsAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "PushAtomsAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+ActionState::ptr SelectionPushAtomsAction::performCall() {
+  LOG(1, "Pushing atom selection.");
+  World::getInstance().pushAtomSelection();
+
+  return Action::success;
+}
+
+ActionState::ptr SelectionPushAtomsAction::performUndo(ActionState::ptr _state) {
+  LOG(1, "Pushing atom selection.");
+  World::getInstance().popAtomSelection();
+
+  return Action::success;
+}
+
+ActionState::ptr SelectionPushAtomsAction::performRedo(ActionState::ptr _state){
+  return performCall();
+}
+
+bool SelectionPushAtomsAction::canUndo() {
+  return true;
+}
+
+bool SelectionPushAtomsAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/Atoms/PushAtomsAction.def
===================================================================
--- src/Actions/SelectionAction/Atoms/PushAtomsAction.def	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ src/Actions/SelectionAction/Atoms/PushAtomsAction.def	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,33 @@
+/*
+ * PushAtomsAction.def
+ *
+ *  Created on: Dec 14, 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 PushAtoms
+#define TOKEN "push-atom-selection"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "push the atom selection from a stack"
+#undef SHORTFORM
Index: src/Actions/SelectionAction/Atoms/PushAtomsAction.hpp
===================================================================
--- src/Actions/SelectionAction/Atoms/PushAtomsAction.hpp	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
+++ src/Actions/SelectionAction/Atoms/PushAtomsAction.hpp	(revision 3213f29e16ba9cf8c7dc57a7343907df2ec3988a)
@@ -0,0 +1,22 @@
+/*
+ * PushAtomsAction.hpp
+ *
+ *  Created on: Dec 14, 2014
+ *      Author: heber
+ */
+
+#ifndef PUSHATOMSACTION_HPP_
+#define PUSHATOMSACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "PushAtomsAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* PUSHATOMSACTION_HPP_ */
