Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision 770287d80fd62a4701803c0bc5a84438f8d5043b)
+++ src/Actions/Makefile.am	(revision 481e9213138a06f3024b941f985d8988719fa579)
@@ -124,4 +124,5 @@
 	SelectionAction/ClearAllMoleculesAction.cpp \
 	SelectionAction/MoleculeByIdAction.cpp \
+	SelectionAction/MoleculeOfAtomAction.cpp \
 	SelectionAction/NotAllAtomsAction.cpp \
 	SelectionAction/NotAllMoleculesAction.cpp \
@@ -136,4 +137,5 @@
 	SelectionAction/ClearAllMoleculesAction.hpp \
 	SelectionAction/MoleculeByIdAction.hpp \
+	SelectionAction/MoleculeOfAtomAction.hpp \
 	SelectionAction/NotAllAtomsAction.hpp \
 	SelectionAction/NotAllMoleculesAction.hpp \
Index: src/Actions/MapOfActions.cpp
===================================================================
--- src/Actions/MapOfActions.cpp	(revision 770287d80fd62a4701803c0bc5a84438f8d5043b)
+++ src/Actions/MapOfActions.cpp	(revision 481e9213138a06f3024b941f985d8988719fa579)
@@ -73,4 +73,5 @@
 #include "Actions/SelectionAction/ClearAllMoleculesAction.hpp"
 #include "Actions/SelectionAction/MoleculeByIdAction.hpp"
+#include "Actions/SelectionAction/MoleculeOfAtomAction.hpp"
 #include "Actions/SelectionAction/NotAllAtomsAction.hpp"
 #include "Actions/SelectionAction/NotAllMoleculesAction.hpp"
@@ -222,4 +223,5 @@
   DescriptionMap["select-atom-by-id"] = "select an atom by index";
   DescriptionMap["select-molecule-by-id"] = "select a molecule by index";
+  DescriptionMap["select-molecule-of-atom"] = "select a molecule to which a given atom belongs";
   DescriptionMap["select-molecules-atoms"] = "select all atoms of a molecule";
   DescriptionMap["set-basis"] = "set the name of the gaussian basis set for MPQC";
@@ -342,4 +344,5 @@
   TypeMap["select-atom-by-id"] = &typeid(atom);
   TypeMap["select-molecule-by-id"] = &typeid(molecule);
+  TypeMap["select-molecule-of-atom"] = &typeid(atom);
   TypeMap["select-molecules-atoms"] = &typeid(molecule);
   TypeMap["set-basis"] = &typeid(std::string);
@@ -457,4 +460,5 @@
   MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-atom-by-id") );
   MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-molecule-by-id") );
+  MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-molecule-of-atom") );
   MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "select-molecules-atoms") );
   MenuContainsActionMap.insert( pair<std::string, std::string> ("selection", "unselect-all-atoms") );
@@ -524,4 +528,5 @@
   generic.insert("select-atom-by-id");
   generic.insert("select-molecule-by-id");
+  generic.insert("select-molecule-of-atom");
   generic.insert("select-molecules-atoms");
   generic.insert("set-basis");
@@ -856,4 +861,5 @@
   new SelectionAtomByIdAction();
   new SelectionMoleculeByIdAction();
+  new SelectionMoleculeOfAtomAction();
   new SelectionNotAllAtomsAction();
   new SelectionNotAllMoleculesAction();
Index: src/Actions/SelectionAction/MoleculeOfAtomAction.cpp
===================================================================
--- src/Actions/SelectionAction/MoleculeOfAtomAction.cpp	(revision 481e9213138a06f3024b941f985d8988719fa579)
+++ src/Actions/SelectionAction/MoleculeOfAtomAction.cpp	(revision 481e9213138a06f3024b941f985d8988719fa579)
@@ -0,0 +1,100 @@
+/*
+ * MoleculeOfAtomAction.cpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Actions/SelectionAction/MoleculeOfAtomAction.hpp"
+#include "Actions/ActionRegistry.hpp"
+#include "Descriptors/MoleculeDescriptor.hpp"
+#include "atom.hpp"
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+#include "UIElements/UIFactory.hpp"
+#include "UIElements/Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// memento to remember the state when undoing
+
+class SelectionMoleculeOfAtomState : public ActionState {
+public:
+  SelectionMoleculeOfAtomState(std::vector<molecule*> selectedMolecules, atom *_Walker) :
+    selectedMolecules(selectedMolecules),
+    Walker(_Walker)
+  {}
+  std::vector<molecule*> selectedMolecules;
+  atom *Walker;
+};
+
+const char SelectionMoleculeOfAtomAction::NAME[] = "select-molecule-of-atom";
+
+SelectionMoleculeOfAtomAction::SelectionMoleculeOfAtomAction() :
+  Action(NAME)
+{}
+
+SelectionMoleculeOfAtomAction::~SelectionMoleculeOfAtomAction()
+{}
+
+void SelectionMoleculeOfAtom() {
+  ActionRegistry::getInstance().getActionByName(SelectionMoleculeOfAtomAction::NAME)->call(Action::NonInteractive);
+};
+
+Dialog* SelectionMoleculeOfAtomAction::fillDialog(Dialog *dialog) {
+  ASSERT(dialog,"No Dialog given when filling action dialog");
+
+  dialog->queryAtom(NAME, ValueStorage::getInstance().getDescription(NAME));
+
+  return dialog;
+}
+
+Action::state_ptr SelectionMoleculeOfAtomAction::performCall() {
+  atom *Walker = NULL;
+
+  ValueStorage::getInstance().queryCurrentValue(NAME, Walker);
+
+  std::vector<molecule *> selectedMolecules = World::getInstance().getSelectedMolecules();
+  DoLog(1) && (Log() << Verbose(1) << "Selecting molecule to which " << Walker->getName() << " belongs." << endl);
+  World::getInstance().selectMoleculeOfAtom(Walker);
+  return Action::state_ptr(new SelectionMoleculeOfAtomState(selectedMolecules, Walker));
+}
+
+Action::state_ptr SelectionMoleculeOfAtomAction::performUndo(Action::state_ptr _state) {
+  SelectionMoleculeOfAtomState *state = assert_cast<SelectionMoleculeOfAtomState*>(_state.get());
+
+  World::getInstance().clearMoleculeSelection();
+  for(std::vector<molecule *>::iterator iter = state->selectedMolecules.begin(); iter != state->selectedMolecules.end(); ++iter)
+    World::getInstance().selectMolecule(*iter);
+
+  return Action::state_ptr(new SelectionMoleculeOfAtomState(state->selectedMolecules, state->Walker));
+}
+
+Action::state_ptr SelectionMoleculeOfAtomAction::performRedo(Action::state_ptr _state){
+  SelectionMoleculeOfAtomState *state = assert_cast<SelectionMoleculeOfAtomState*>(_state.get());
+
+  World::getInstance().selectMoleculeOfAtom(state->Walker);
+
+  return Action::state_ptr(new SelectionMoleculeOfAtomState(state->selectedMolecules, state->Walker));
+}
+
+bool SelectionMoleculeOfAtomAction::canUndo() {
+  return true;
+}
+
+bool SelectionMoleculeOfAtomAction::shouldUndo() {
+  return true;
+}
+
+const string SelectionMoleculeOfAtomAction::getName() {
+  return NAME;
+}
Index: src/Actions/SelectionAction/MoleculeOfAtomAction.hpp
===================================================================
--- src/Actions/SelectionAction/MoleculeOfAtomAction.hpp	(revision 481e9213138a06f3024b941f985d8988719fa579)
+++ src/Actions/SelectionAction/MoleculeOfAtomAction.hpp	(revision 481e9213138a06f3024b941f985d8988719fa579)
@@ -0,0 +1,36 @@
+/*
+ * MoleculeOfAtomAction.hpp
+ *
+ *  Created on: May 12, 2010
+ *      Author: heber
+ */
+
+#ifndef MOLECULEOFATOMSACTION_HPP_
+#define MOLECULEOFATOMSACTION_HPP_
+
+#include "Actions/Action.hpp"
+
+void SelectionMoleculeOfAtom();
+
+class SelectionMoleculeOfAtomAction : public Action {
+  friend void SelectionMoleculeOfAtom();
+
+public:
+  SelectionMoleculeOfAtomAction();
+  virtual ~SelectionMoleculeOfAtomAction();
+
+  bool canUndo();
+  bool shouldUndo();
+
+  virtual const std::string getName();
+protected:
+  virtual Dialog * fillDialog(Dialog *dialog);
+private:
+  virtual Action::state_ptr performCall();
+  virtual Action::state_ptr performUndo(Action::state_ptr);
+  virtual Action::state_ptr performRedo(Action::state_ptr);
+
+  static const char NAME[];
+};
+
+#endif /* MOLECULEOFATOMSACTION_HPP_ */
