Index: src/Actions/BondAction/BondAddAction.cpp
===================================================================
--- src/Actions/BondAction/BondAddAction.cpp	(revision e708189b420f9ea019be44095fe2f70853e6f70e)
+++ src/Actions/BondAction/BondAddAction.cpp	(revision f01bb307e5f23caab8ee043dfd247d11d9c17112)
@@ -41,4 +41,5 @@
 #include "CodePatterns/Verbose.hpp"
 #include "Descriptors/AtomIdDescriptor.hpp"
+#include "molecule.hpp"
 #include "World.hpp"
 #include "WorldTime.hpp"
@@ -63,4 +64,24 @@
   }
 
+  // check if we are adding new atoms to a molecule
+  molecules_t molecules;
+  const molecule *add_to_mol_const = NULL;
+  molecules.reserve(world.countSelectedAtoms());
+  for (World::AtomSelectionConstIterator firstiter = world.beginAtomSelection();
+      firstiter != world.endAtomSelection(); ++firstiter) {
+    const molecule * const current_mol = firstiter->second->getMolecule();
+    molecules.push_back(current_mol);
+    if (current_mol != NULL) {
+      if (add_to_mol_const == NULL)
+        add_to_mol_const = current_mol;
+      else if (add_to_mol_const != current_mol) {
+        // we encountered a second molecule, don't set the molecules
+        molecules.clear();
+        add_to_mol_const = NULL;
+        break;
+      }
+    }
+  }
+
   bondPairIds_t bondPairIds;
   for (World::AtomSelectionConstIterator firstiter = world.beginAtomSelection();
@@ -81,11 +102,17 @@
 
   // create undo
-  BondAddState *UndoState = new BondAddState(bondPairIds, params);
+  molecule *add_to_mol = NULL;
+  if (add_to_mol_const != NULL) {
+    add_to_mol = world.getMolecule(MoleculeById(add_to_mol_const->getId()));
+    ASSERT( add_to_mol != NULL,
+        "BondAddAction::performCall() - could not obtain molecule from World.");
+  }
+  BondAddState *UndoState = new BondAddState(bondPairIds, molecules, add_to_mol, params);
 
   // execute action
   for (bondPairIds_t::const_iterator iter = bondPairIds.begin();
       iter != bondPairIds.end(); ++iter) {
-    atom *firstatom = world.getAtom(AtomById(iter->first));
-    atom *secondatom = world.getAtom(AtomById(iter->second));
+    atom * const firstatom = world.getAtom(AtomById(iter->first));
+    atom * const secondatom = world.getAtom(AtomById(iter->second));
     ASSERT((firstatom != NULL) && (secondatom != NULL),
         "BondAddAction::performCall() - at least one of the ids "
@@ -97,4 +124,10 @@
       +toString(*firstatom)+" and "+toString(*secondatom)+" failed.");
   }
+  if (add_to_mol != NULL)
+    for (World::AtomSelectionIterator firstiter = world.beginAtomSelection();
+        firstiter != world.endAtomSelection(); ++firstiter) {
+      if (firstiter->second->getMolecule() != add_to_mol)
+        add_to_mol->AddAtom(firstiter->second);
+    }
 
   return ActionState::ptr(UndoState);
@@ -120,4 +153,22 @@
     }
   }
+  if (state->add_to_mol != NULL) {
+    molecules_t::const_iterator mol_iter = state->molecules.begin();
+    for (World::AtomSelectionIterator firstiter = world.beginAtomSelection();
+        firstiter != world.endAtomSelection(); ++firstiter) {
+      const molecule * const current_mol = *mol_iter++;
+      atom * const Walker = firstiter->second;
+      if (current_mol != Walker->getMolecule()) {
+        if (Walker->getMolecule() != NULL)
+          Walker->removeFromMolecule();
+        if (current_mol != NULL) {
+          molecule *add_to_mol = world.getMolecule(MoleculeById(current_mol->getId()));
+          add_to_mol->AddAtom(Walker);
+        }
+      }
+    }
+    ASSERT(mol_iter == state->molecules.end(),
+        "BondAddAction::performUndo() - number of molecule ptrs not coinciding with number of selected atoms.");
+  }
 
   return ActionState::ptr(_state);
@@ -143,4 +194,10 @@
     }
   }
+  if (state->add_to_mol != NULL)
+    for (World::AtomSelectionIterator firstiter = world.beginAtomSelection();
+        firstiter != world.endAtomSelection(); ++firstiter) {
+      if (firstiter->second->getMolecule() != state->add_to_mol)
+        state->add_to_mol->AddAtom(firstiter->second);
+    }
 
   return ActionState::ptr(_state);
Index: src/Actions/BondAction/BondAddAction.def
===================================================================
--- src/Actions/BondAction/BondAddAction.def	(revision e708189b420f9ea019be44095fe2f70853e6f70e)
+++ src/Actions/BondAction/BondAddAction.def	(revision f01bb307e5f23caab8ee043dfd247d11d9c17112)
@@ -12,4 +12,5 @@
 
 typedef std::vector<std::pair<atomId_t,atomId_t> > bondPairIds_t;
+typedef std::vector<const molecule*> molecules_t;
 
 #include "Parameters/Validators/RangeValidator.hpp"
@@ -27,6 +28,6 @@
 (RangeValidator<int>(1,10))
 
-#define statetypes (bondPairIds_t)
-#define statereferences (bondPairIds)
+#define statetypes (bondPairIds_t)(molecules_t)(molecule *)
+#define statereferences (bondPairIds)(molecules)(add_to_mol)
 
 // some defines for all the names, you may use ACTION, STATE and PARAMS
