Index: src/Actions/SelectionAction/Atoms/AtomByOrderAction.cpp
===================================================================
--- src/Actions/SelectionAction/Atoms/AtomByOrderAction.cpp	(revision 61c364e5234bfac462d451e14f2d8a128787f6bb)
+++ src/Actions/SelectionAction/Atoms/AtomByOrderAction.cpp	(revision 61c364e5234bfac462d451e14f2d8a128787f6bb)
@@ -0,0 +1,84 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010-2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * AtomByOrderAction.cpp
+ *
+ *  Created on: Mar 22, 2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "Atom/atom.hpp"
+#include "CodePatterns/Log.hpp"
+#include "CodePatterns/Verbose.hpp"
+#include "World.hpp"
+#include "Descriptors/AtomIdDescriptor.hpp"
+#include "Descriptors/AtomOrderDescriptor.hpp"
+
+#include <iostream>
+#include <string>
+
+#include "AtomByOrderAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "AtomByOrderAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr SelectionAtomByOrderAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
+
+  const atom *Walker = World::getInstance().getAtom(AtomByOrder(params.order));
+  if (Walker != NULL) {
+    if (!World::getInstance().isSelected(Walker)) {
+      LOG(1, "Selecting atom " << *Walker);
+      World::getInstance().selectAtom(Walker);
+      LOG(0, World::getInstance().countSelectedAtoms() << " atoms selected.");
+      return Action::state_ptr(new SelectionAtomByOrderState(Walker->getId(), params));
+    } else {
+      return Action::success;
+    }
+  } else {
+    return Action::failure;
+  }
+}
+
+Action::state_ptr SelectionAtomByOrderAction::performUndo(Action::state_ptr _state) {
+  SelectionAtomByOrderState *state = assert_cast<SelectionAtomByOrderState*>(_state.get());
+
+  const atom *Walker = World::getInstance().getAtom(AtomById(state->WalkerId));
+  World::getInstance().unselectAtom(Walker);
+
+  return Action::state_ptr(_state);
+}
+
+Action::state_ptr SelectionAtomByOrderAction::performRedo(Action::state_ptr _state){
+  SelectionAtomByOrderState *state = assert_cast<SelectionAtomByOrderState*>(_state.get());
+
+  const atom *Walker = World::getInstance().getAtom(AtomById(state->WalkerId));
+  World::getInstance().selectAtom(Walker);
+
+  return Action::state_ptr(_state);
+}
+
+bool SelectionAtomByOrderAction::canUndo() {
+  return true;
+}
+
+bool SelectionAtomByOrderAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/Atoms/AtomByOrderAction.def
===================================================================
--- src/Actions/SelectionAction/Atoms/AtomByOrderAction.def	(revision 61c364e5234bfac462d451e14f2d8a128787f6bb)
+++ src/Actions/SelectionAction/Atoms/AtomByOrderAction.def	(revision 61c364e5234bfac462d451e14f2d8a128787f6bb)
@@ -0,0 +1,33 @@
+/*
+ * AtomByOrderAction.def
+ *
+ *  Created on: Mar 22, 2012
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class atom;
+
+// 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 (NODEFAULT) for each (undefined) default value
+#define paramtypes (int)
+#define paramtokens ("select-atom-by-order")
+#define paramdescriptions ("order index")
+#undef paramdefaults
+#define paramreferences (order)
+
+#define statetypes (atomId_t)
+#define statereferences (WalkerId)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define MENUNAME "selection"
+#define MENUPOSITION 6
+#define ACTIONNAME AtomByOrder
+#define TOKEN "select-atom-by-order"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "select an atom by order of appearance"
+#undef SHORTFORM
Index: src/Actions/SelectionAction/Atoms/AtomByOrderAction.hpp
===================================================================
--- src/Actions/SelectionAction/Atoms/AtomByOrderAction.hpp	(revision 61c364e5234bfac462d451e14f2d8a128787f6bb)
+++ src/Actions/SelectionAction/Atoms/AtomByOrderAction.hpp	(revision 61c364e5234bfac462d451e14f2d8a128787f6bb)
@@ -0,0 +1,22 @@
+/*
+ * AtomByOrderAction.hpp
+ *
+ *  Created on: Mar 22, 2012
+ *      Author: heber
+ */
+
+#ifndef ATOMBYORDERACTION_HPP_
+#define ATOMBYORDERACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "AtomByOrderAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* ATOMBYORDERACTION_HPP_ */
Index: src/Actions/SelectionAction/Atoms/NotAtomByOrderAction.cpp
===================================================================
--- src/Actions/SelectionAction/Atoms/NotAtomByOrderAction.cpp	(revision 61c364e5234bfac462d451e14f2d8a128787f6bb)
+++ src/Actions/SelectionAction/Atoms/NotAtomByOrderAction.cpp	(revision 61c364e5234bfac462d451e14f2d8a128787f6bb)
@@ -0,0 +1,84 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010-2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * NotAtomByOrderAction.cpp
+ *
+ *  Created on: Mar 22, 2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "Atom/atom.hpp"
+#include "CodePatterns/Log.hpp"
+#include "CodePatterns/Verbose.hpp"
+#include "Descriptors/AtomIdDescriptor.hpp"
+#include "Descriptors/AtomOrderDescriptor.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+#include "NotAtomByOrderAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "NotAtomByOrderAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+Action::state_ptr SelectionNotAtomByOrderAction::performCall() {
+  // obtain information
+  getParametersfromValueStorage();
+
+  const atom * Walker = World::getInstance().getAtom(AtomByOrder(params.order));
+  if (Walker != NULL) {
+    if (World::getInstance().isSelected(Walker)) {
+      LOG(1, "Unselecting atom " << *Walker);
+      World::getInstance().unselectAtom(Walker);
+      LOG(0, World::getInstance().countSelectedAtoms() << " atoms remain selected.");
+      return Action::state_ptr(new SelectionNotAtomByOrderState(Walker->getId(), params));
+    } else {
+      return Action::success;
+    }
+  } else {
+    return Action::failure;
+  }
+}
+
+Action::state_ptr SelectionNotAtomByOrderAction::performUndo(Action::state_ptr _state) {
+  SelectionNotAtomByOrderState *state = assert_cast<SelectionNotAtomByOrderState*>(_state.get());
+
+  const atom * Walker = World::getInstance().getAtom(AtomById(state->WalkerId));
+  World::getInstance().selectAtom(Walker);
+
+  return Action::state_ptr(_state);
+}
+
+Action::state_ptr SelectionNotAtomByOrderAction::performRedo(Action::state_ptr _state){
+  SelectionNotAtomByOrderState *state = assert_cast<SelectionNotAtomByOrderState*>(_state.get());
+
+  const atom * Walker = World::getInstance().getAtom(AtomById(state->WalkerId));
+  World::getInstance().unselectAtom(Walker);
+
+  return Action::state_ptr(_state);
+}
+
+bool SelectionNotAtomByOrderAction::canUndo() {
+  return true;
+}
+
+bool SelectionNotAtomByOrderAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/SelectionAction/Atoms/NotAtomByOrderAction.def
===================================================================
--- src/Actions/SelectionAction/Atoms/NotAtomByOrderAction.def	(revision 61c364e5234bfac462d451e14f2d8a128787f6bb)
+++ src/Actions/SelectionAction/Atoms/NotAtomByOrderAction.def	(revision 61c364e5234bfac462d451e14f2d8a128787f6bb)
@@ -0,0 +1,33 @@
+/*
+ * NotAtomByOrderAction.def
+ *
+ *  Created on: Mar 22, 2012
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+class atom;
+
+// 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 (NODEFAULT) for each (undefined) default value
+#define paramtypes (int)
+#define paramtokens ("unselect-atom-by-order")
+#define paramdescriptions ("order index")
+#undef paramdefaults
+#define paramreferences (order)
+
+#define statetypes (atomId_t)
+#define statereferences (WalkerId)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Selection
+#define MENUNAME "selection"
+#define MENUPOSITION 16
+#define ACTIONNAME NotAtomByOrder
+#define TOKEN "unselect-atom-by-order"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "unselect an atom by order of appearance"
+#undef SHORTFORM
Index: src/Actions/SelectionAction/Atoms/NotAtomByOrderAction.hpp
===================================================================
--- src/Actions/SelectionAction/Atoms/NotAtomByOrderAction.hpp	(revision 61c364e5234bfac462d451e14f2d8a128787f6bb)
+++ src/Actions/SelectionAction/Atoms/NotAtomByOrderAction.hpp	(revision 61c364e5234bfac462d451e14f2d8a128787f6bb)
@@ -0,0 +1,22 @@
+/*
+ * NotAtomByOrderAction.hpp
+ *
+ *  Created on: Mar 22, 2012
+ *      Author: heber
+ */
+
+#ifndef NOTATOMBYORDERACTION_HPP_
+#define NOTATOMBYORDERACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "NotAtomByOrderAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* NOTATOMBYORDERACTION_HPP_ */
