Index: src/unittests/AnalysisCorrelationToPointUnitTest.cpp
===================================================================
--- src/unittests/AnalysisCorrelationToPointUnitTest.cpp	(revision e6fdbe351d84e5890c3e6056f3c678ec947d0b31)
+++ src/unittests/AnalysisCorrelationToPointUnitTest.cpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -17,4 +17,5 @@
 #include "AnalysisCorrelationToPointUnitTest.hpp"
 
+#include "World.hpp"
 #include "atom.hpp"
 #include "boundary.hpp"
@@ -56,22 +57,22 @@
 
   // construct periodentafel
-  tafel = new periodentafel;
+  tafel = World::get()->getPeriode();
   tafel->AddElement(hydrogen);
 
   // construct molecule (tetraeder of hydrogens)
-  TestMolecule = new molecule(tafel);
-  Walker = new atom();
+  TestMolecule = World::get()->createMolecule();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(1., 0., 1. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(0., 1., 1. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(1., 1., 0. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(0., 0., 0. );
@@ -81,5 +82,5 @@
   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
 
-  TestList = new MoleculeListClass;
+  TestList = World::get()->getMolecules();
   TestMolecule->ActiveFlag = true;
   TestList->insert(TestMolecule);
@@ -102,10 +103,5 @@
     delete(binmap);
 
-  // remove
-  delete(TestList);
-  // note that all the atoms are cleaned by TestMolecule
   delete(point);
-  delete(tafel);
-  // note that element is cleaned by periodentafel
   World::destroy();
   MemoryUsageObserver::purgeInstance();
Index: src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
===================================================================
--- src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp	(revision e6fdbe351d84e5890c3e6056f3c678ec947d0b31)
+++ src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -17,4 +17,5 @@
 #include "AnalysisCorrelationToSurfaceUnitTest.hpp"
 
+#include "World.hpp"
 #include "atom.hpp"
 #include "boundary.hpp"
@@ -60,23 +61,23 @@
 
   // construct periodentafel
-  tafel = new periodentafel;
+  tafel = World::get()->getPeriode();
   tafel->AddElement(hydrogen);
   tafel->AddElement(carbon);
 
   // construct molecule (tetraeder of hydrogens) base
-  TestMolecule = new molecule(tafel);
-  Walker = new atom();
+  TestMolecule = World::get()->createMolecule();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(1., 0., 1. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(0., 1., 1. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(1., 1., 0. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(0., 0., 0. );
@@ -86,5 +87,5 @@
   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
 
-  TestList = new MoleculeListClass;
+  TestList = World::get()->getMolecules();
   TestMolecule->ActiveFlag = true;
   TestList->insert(TestMolecule);
@@ -99,18 +100,18 @@
 
   // add outer atoms
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = carbon;
   Walker->node->Init(4., 0., 4. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = carbon;
   Walker->node->Init(0., 4., 4. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = carbon;
   Walker->node->Init(4., 4., 0. );
   TestMolecule->AddAtom(Walker);
   // add inner atoms
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = carbon;
   Walker->node->Init(0.5, 0.5, 0.5 );
@@ -131,11 +132,7 @@
     delete(binmap);
 
-  // remove
-  delete(TestList);
   delete(Surface);
   // note that all the atoms are cleaned by TestMolecule
   delete(LC);
-  delete(tafel);
-  // note that element is cleaned by periodentafel
   World::destroy();
   MemoryUsageObserver::purgeInstance();
Index: src/unittests/AnalysisPairCorrelationUnitTest.cpp
===================================================================
--- src/unittests/AnalysisPairCorrelationUnitTest.cpp	(revision e6fdbe351d84e5890c3e6056f3c678ec947d0b31)
+++ src/unittests/AnalysisPairCorrelationUnitTest.cpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -17,4 +17,5 @@
 #include "AnalysisPairCorrelationUnitTest.hpp"
 
+#include "World.hpp"
 #include "atom.hpp"
 #include "boundary.hpp"
@@ -55,22 +56,22 @@
 
   // construct periodentafel
-  tafel = new periodentafel;
+  tafel = World::get()->getPeriode();
   tafel->AddElement(hydrogen);
 
   // construct molecule (tetraeder of hydrogens)
-  TestMolecule = new molecule(tafel);
-  Walker = new atom();
+  TestMolecule = World::get()->createMolecule();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(1., 0., 1. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(0., 1., 1. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(1., 1., 0. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(0., 0., 0. );
@@ -80,5 +81,5 @@
   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
 
-  TestList = new MoleculeListClass;
+  TestList = World::get()->getMolecules();
   TestMolecule->ActiveFlag = true;
   TestList->insert(TestMolecule);
@@ -98,9 +99,5 @@
     delete(binmap);
 
-  // remove
-  delete(TestList);
   // note that all the atoms are cleaned by TestMolecule
-  delete(tafel);
-  // note that element is cleaned by periodentafel
   World::destroy();
   MemoryUsageObserver::purgeInstance();
Index: src/unittests/DescriptorUnittest.cpp
===================================================================
--- src/unittests/DescriptorUnittest.cpp	(revision e6fdbe351d84e5890c3e6056f3c678ec947d0b31)
+++ src/unittests/DescriptorUnittest.cpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -27,46 +27,28 @@
 CPPUNIT_TEST_SUITE_REGISTRATION( DescriptorUnittest );
 
-// some stubs
-class AtomStub : public atom {
-public:
-  AtomStub(int _id) :
-  atom(),
-  id(_id)
-  {}
-
-  virtual int getId(){
-    return id;
-  }
-
-private:
-  int id;
-};
-
-
 // set up and tear down
 void DescriptorUnittest::setUp(){
   World::get();
   for(int i=0;i<ATOM_COUNT;++i){
-    atoms[i]= new AtomStub(i);
+    atoms[i]= World::get()->createAtom();
+    atomIds[i] = atoms[i]->getId();
   }
 }
 void DescriptorUnittest::tearDown(){
   World::destroy();
-  for(int i=0;i<ATOM_COUNT;++i){
-    delete atoms[i];
-  }
 }
 
 // some helper functions
-bool hasAll(std::vector<atom*> atoms,int min, int max, std::set<int> excluded = std::set<int>()){
-  for(int i=min;i<max;++i){
-    if(!excluded.count(i)){
+bool hasAll(std::vector<atom*> atoms,int ids[ATOM_COUNT], std::set<int> excluded = std::set<int>()){
+  for(int i=0;i<ATOM_COUNT;++i){
+    int id = ids[i];
+    if(!excluded.count(id)){
       std::vector<atom*>::iterator iter;
       bool res=false;
       for(iter=atoms.begin();iter!=atoms.end();++iter){
-        res |= (*iter)->getId() == i;
+        res |= (*iter)->getId() == id;
       }
       if(!res) {
-        cout << "Atom " << i << " missing in returned list" << endl;
+        cout << "Atom " << id << " missing in returned list" << endl;
         return false;
       }
@@ -91,5 +73,5 @@
 void DescriptorUnittest::AtomBaseSetsTest(){
   std::vector<atom*> allAtoms = World::get()->getAllAtoms(AllAtoms());
-  CPPUNIT_ASSERT_EQUAL( true , hasAll(allAtoms,0,ATOM_COUNT));
+  CPPUNIT_ASSERT_EQUAL( true , hasAll(allAtoms,atomIds));
   CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicates(allAtoms));
 
@@ -100,13 +82,26 @@
   // test Atoms from boundaries and middle of the set
   atom* testAtom;
-  testAtom = World::get()->getAtom(AtomById(0));
-  CPPUNIT_ASSERT_EQUAL( 0, testAtom->getId());
-  testAtom = World::get()->getAtom(AtomById(ATOM_COUNT/2));
-  CPPUNIT_ASSERT_EQUAL( ATOM_COUNT/2, testAtom->getId());
-  testAtom = World::get()->getAtom(AtomById(ATOM_COUNT-1));
-  CPPUNIT_ASSERT_EQUAL( ATOM_COUNT-1, testAtom->getId());
+  testAtom = World::get()->getAtom(AtomById(atomIds[0]));
+  CPPUNIT_ASSERT(testAtom);
+  CPPUNIT_ASSERT_EQUAL( atomIds[0], testAtom->getId());
+  testAtom = World::get()->getAtom(AtomById(atomIds[ATOM_COUNT/2]));
+  CPPUNIT_ASSERT(testAtom);
+  CPPUNIT_ASSERT_EQUAL( atomIds[ATOM_COUNT/2], testAtom->getId());
+  testAtom = World::get()->getAtom(AtomById(atomIds[ATOM_COUNT-1]));
+  CPPUNIT_ASSERT(testAtom);
+  CPPUNIT_ASSERT_EQUAL( atomIds[ATOM_COUNT-1], testAtom->getId());
 
+  // find some ID that has not been created
+  int outsideId =-1;
+  bool res = false;
+  while(!res) {
+    ++outsideId;
+    res = true;
+    for(int i = 0; i < ATOM_COUNT; ++i){
+      res &= atomIds[i]!=outsideId;
+    }
+  }
   // test from outside of set
-  testAtom = World::get()->getAtom(AtomById(ATOM_COUNT));
+  testAtom = World::get()->getAtom(AtomById(outsideId));
   CPPUNIT_ASSERT(!testAtom);
 }
@@ -115,5 +110,5 @@
   {
     std::vector<atom*> testAtoms = World::get()->getAllAtoms(AllAtoms()||NoAtoms());
-    CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,0,ATOM_COUNT));
+    CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,atomIds));
     CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicates(testAtoms));
   }
@@ -121,5 +116,5 @@
   {
     std::vector<atom*> testAtoms = World::get()->getAllAtoms(NoAtoms()||AllAtoms());
-    CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,0,ATOM_COUNT));
+    CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,atomIds));
     CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicates(testAtoms));
   }
@@ -142,5 +137,5 @@
   {
     std::vector<atom*> testAtoms = World::get()->getAllAtoms(!NoAtoms());
-    CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,0,ATOM_COUNT));
+    CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,atomIds));
     CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicates(testAtoms));
   }
@@ -148,8 +143,8 @@
   // exclude and include some atoms
   {
-    std::vector<atom*> testAtoms = World::get()->getAllAtoms(AllAtoms()&&(!AtomById(ATOM_COUNT/2)));
+    std::vector<atom*> testAtoms = World::get()->getAllAtoms(AllAtoms()&&(!AtomById(atomIds[ATOM_COUNT/2])));
     std::set<int> excluded;
-    excluded.insert(ATOM_COUNT/2);
-    CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,0,ATOM_COUNT,excluded));
+    excluded.insert(atomIds[ATOM_COUNT/2]);
+    CPPUNIT_ASSERT_EQUAL( true , hasAll(testAtoms,atomIds,excluded));
     CPPUNIT_ASSERT_EQUAL( true , hasNoDuplicates(testAtoms));
     CPPUNIT_ASSERT_EQUAL( (size_t)(ATOM_COUNT-1), testAtoms.size());
@@ -157,7 +152,7 @@
 
   {
-    std::vector<atom*> testAtoms = World::get()->getAllAtoms(NoAtoms()||(AtomById(ATOM_COUNT/2)));
+    std::vector<atom*> testAtoms = World::get()->getAllAtoms(NoAtoms()||(AtomById(atomIds[ATOM_COUNT/2])));
     CPPUNIT_ASSERT_EQUAL( (size_t)1, testAtoms.size());
-    CPPUNIT_ASSERT_EQUAL( ATOM_COUNT/2, testAtoms[0]->getId());
+    CPPUNIT_ASSERT_EQUAL( atomIds[ATOM_COUNT/2], testAtoms[0]->getId());
   }
 }
Index: src/unittests/DescriptorUnittest.hpp
===================================================================
--- src/unittests/DescriptorUnittest.hpp	(revision e6fdbe351d84e5890c3e6056f3c678ec947d0b31)
+++ src/unittests/DescriptorUnittest.hpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -33,4 +33,5 @@
 private:
   atom *atoms [ATOM_COUNT];
+  int atomIds [ATOM_COUNT];
 };
 
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision e6fdbe351d84e5890c3e6056f3c678ec947d0b31)
+++ src/unittests/Makefile.am	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -30,6 +30,10 @@
   CacheableTest \
   DescriptorUnittest \
-  ${MENUTESTS}  
-    
+  manipulateAtomsTest \
+  atomsCalculationTest \
+  ${MENUTESTS}
+  
+
+      
   
 check_PROGRAMS = $(TESTS) 
@@ -60,8 +64,10 @@
   tesselation_insideoutsideunittest.cpp \
   vectorunittest.cpp \
-  ActionSequenceTest.cpp \
   ObserverTest.cpp \
   CacheableTest.cpp \
-  DescriptorUnittest.cpp
+  DescriptorUnittest.cpp \
+  manipulateAtomsTest.cpp \
+  atomsCalculationTest.cpp \
+  ActionSequenceTest.cpp
 
 TESTHEADERS = \
@@ -140,4 +146,10 @@
 DescriptorUnittest_LDADD = ${ALLLIBS}
 
+manipulateAtomsTest_SOURCES = UnitTestMain.cpp manipulateAtomsTest.cpp manipulateAtomsTest.hpp
+manipulateAtomsTest_LDADD = ${ALLLIBS}
+
+atomsCalculationTest_SOURCES = UnitTestMain.cpp atomsCalculationTest.cpp atomsCalculationTest.hpp
+atomsCalculationTest_LDADD = ${ALLLIBS}
+
 TestRunner_SOURCES = TestRunnerMain.cpp $(TESTSOURCES) $(TESTHEADERS)
 TestRunner_LDADD = ${ALLLIBS}
Index: src/unittests/analysisbondsunittest.cpp
===================================================================
--- src/unittests/analysisbondsunittest.cpp	(revision e6fdbe351d84e5890c3e6056f3c678ec947d0b31)
+++ src/unittests/analysisbondsunittest.cpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -16,4 +16,5 @@
 #include <cstring>
 
+#include "World.hpp"
 #include "analysis_bonds.hpp"
 #include "analysisbondsunittest.hpp"
@@ -60,27 +61,27 @@
 
   // construct periodentafel
-  tafel = new periodentafel;
+  tafel = World::get()->getPeriode();
   tafel->AddElement(hydrogen);
   tafel->AddElement(carbon);
 
   // construct molecule (tetraeder of hydrogens)
-  TestMolecule = new molecule(tafel);
-  Walker = new atom();
+  TestMolecule = World::get()->createMolecule();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(1.5, 0., 1.5 );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(0., 1.5, 1.5 );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(1.5, 1.5, 0. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(0., 0., 0. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = carbon;
   Walker->node->Init(0.5, 0.5, 0.5 );
@@ -116,8 +117,7 @@
 
   // remove molecule
-  delete(TestMolecule);
+  World::get()->destroyMolecule(TestMolecule);
   // note that all the atoms are cleaned by TestMolecule
-  delete(tafel);
-  // note that element is cleaned by periodentafel
+  World::destroy();
 };
 
Index: src/unittests/atomsCalculationTest.cpp
===================================================================
--- src/unittests/atomsCalculationTest.cpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
+++ src/unittests/atomsCalculationTest.cpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -0,0 +1,117 @@
+/*
+ * atomsCalculationTest.cpp
+ *
+ *  Created on: Feb 19, 2010
+ *      Author: crueger
+ */
+
+#include "atomsCalculationTest.hpp"
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+#include <iostream>
+#include <boost/bind.hpp>
+
+#include "Descriptors/AtomDescriptor.hpp"
+#include "Descriptors/AtomIdDescriptor.hpp"
+#include "Actions/AtomsCalculation.hpp"
+#include "Actions/AtomsCalculation_impl.hpp"
+#include "Actions/ActionRegistry.hpp"
+
+#include "World.hpp"
+#include "World_calculations.hpp"
+#include "atom.hpp"
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( atomsCalculationTest );
+
+// some stubs
+class AtomStub : public atom {
+public:
+  AtomStub(int _id) :
+  atom(),
+  id(_id),
+  manipulated(false)
+  {}
+
+  virtual int getId(){
+    return id;
+  }
+
+  virtual void doSomething(){
+    manipulated = true;
+  }
+
+  bool manipulated;
+private:
+  int id;
+};
+
+// set up and tear down
+void atomsCalculationTest::setUp(){
+  World::get();
+  for(int i=0;i<ATOM_COUNT;++i){
+    atoms[i]= new AtomStub(i);
+    World::get()->registerAtom(atoms[i]);
+  }
+}
+void atomsCalculationTest::tearDown(){
+  World::destroy();
+  ActionRegistry::purgeRegistry();
+}
+
+// some helper functions
+static bool hasAll(std::vector<int> ids,int min, int max, std::set<int> excluded = std::set<int>()){
+  for(int i=min;i<max;++i){
+    if(!excluded.count(i)){
+      std::vector<int>::iterator iter;
+      bool res=false;
+      for(iter=ids.begin();iter!=ids.end();++iter){
+        res |= (*iter) == i;
+      }
+      if(!res) {
+        cout << "Atom " << i << " missing in returned list" << endl;
+        return false;
+      }
+    }
+  }
+  return true;
+}
+
+static bool hasNoDuplicates(std::vector<int> ids){
+  std::set<int> found;
+  std::vector<int>::iterator iter;
+  for(iter=ids.begin();iter!=ids.end();++iter){
+    int id = (*iter);
+    if(found.count(id))
+      return false;
+    found.insert(id);
+  }
+  return true;
+}
+
+static void operation(atom* _atom){
+  AtomStub *atom = dynamic_cast<AtomStub*>(_atom);
+  assert(atom);
+  atom->doSomething();
+}
+
+
+void atomsCalculationTest::testCalculateSimple(){
+  AtomsCalculation<int> *calc = World::get()->calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms());
+  std::vector<int> allIds = (*calc)();
+  CPPUNIT_ASSERT(hasAll(allIds,0,ATOM_COUNT));
+  CPPUNIT_ASSERT(hasNoDuplicates(allIds));
+}
+
+void atomsCalculationTest::testCalculateExcluded(){
+  int excluded = ATOM_COUNT/2;
+  AtomsCalculation<int> *calc = World::get()->calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms() && !AtomById(excluded));
+  std::vector<int> allIds = (*calc)();
+  std::set<int> excluded_set;
+  excluded_set.insert(excluded);
+  CPPUNIT_ASSERT(hasAll(allIds,0,ATOM_COUNT,excluded_set));
+  CPPUNIT_ASSERT(hasNoDuplicates(allIds));
+  CPPUNIT_ASSERT_EQUAL((size_t)(ATOM_COUNT-1),allIds.size());
+}
Index: src/unittests/atomsCalculationTest.hpp
===================================================================
--- src/unittests/atomsCalculationTest.hpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
+++ src/unittests/atomsCalculationTest.hpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -0,0 +1,36 @@
+/*
+ * atomsCalculationTest.hpp
+ *
+ *  Created on: Feb 19, 2010
+ *      Author: crueger
+ */
+
+#ifndef ATOMSCALCULATIONTEST_HPP_
+#define ATOMSCALCULATIONTEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#define ATOM_COUNT (10)
+
+class atom;
+
+class atomsCalculationTest :  public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE( atomsCalculationTest );
+  CPPUNIT_TEST ( testCalculateSimple );
+  CPPUNIT_TEST ( testCalculateExcluded );
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+  void setUp();
+  void tearDown();
+
+  void testCalculateSimple();
+  void testCalculateExcluded();
+
+private:
+  atom *atoms [ATOM_COUNT];
+  int atomIds [ATOM_COUNT];
+};
+
+#endif /* ATOMSCALCULATIONTEST_HPP_ */
Index: src/unittests/bondgraphunittest.cpp
===================================================================
--- src/unittests/bondgraphunittest.cpp	(revision e6fdbe351d84e5890c3e6056f3c678ec947d0b31)
+++ src/unittests/bondgraphunittest.cpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -16,4 +16,5 @@
 #include <cstring>
 
+#include "World.hpp"
 #include "atom.hpp"
 #include "bond.hpp"
@@ -56,23 +57,23 @@
 
   // construct periodentafel
-  tafel = new periodentafel;
+  tafel = World::get()->getPeriode();
   tafel->AddElement(hydrogen);
   tafel->AddElement(carbon);
 
   // construct molecule (tetraeder of hydrogens)
-  TestMolecule = new molecule(tafel);
-  Walker = new atom();
+  TestMolecule = World::get()->createMolecule();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(1., 0., 1. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(0., 1., 1. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(1., 1., 0. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(0., 0., 0. );
@@ -101,8 +102,7 @@
 
   // remove molecule
-  delete(TestMolecule);
-  // note that all the atoms are cleaned by TestMolecule
-  delete(tafel);
-  // note that element is cleaned by periodentafel
+  World::get()->destroyMolecule(TestMolecule);
+  // note that all the atoms, molecules, the tafel and the elements
+  // are all cleaned when the world is destroyed
   World::destroy();
   MemoryUsageObserver::purgeInstance();
Index: src/unittests/listofbondsunittest.cpp
===================================================================
--- src/unittests/listofbondsunittest.cpp	(revision e6fdbe351d84e5890c3e6056f3c678ec947d0b31)
+++ src/unittests/listofbondsunittest.cpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -16,4 +16,5 @@
 #include "listofbondsunittest.hpp"
 
+#include "World.hpp"
 #include "atom.hpp"
 #include "bond.hpp"
@@ -50,22 +51,22 @@
 
   // construct periodentafel
-  tafel = new periodentafel;
+  tafel = World::get()->getPeriode();
   tafel->AddElement(hydrogen);
 
   // construct molecule (tetraeder of hydrogens)
-  TestMolecule = new molecule(tafel);
-  Walker = new atom();
+  TestMolecule = World::get()->createMolecule();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(1., 0., 1. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(0., 1., 1. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(1., 1., 0. );
   TestMolecule->AddAtom(Walker);
-  Walker = new atom();
+  Walker = World::get()->createAtom();
   Walker->type = hydrogen;
   Walker->node->Init(0., 0., 0. );
@@ -81,8 +82,7 @@
 {
   // remove
-  delete(TestMolecule);
-  // note that all the atoms are cleaned by TestMolecule
-  delete(tafel);
-  // note that element is cleaned by periodentafel
+  World::get()->destroyMolecule(TestMolecule);
+  // note that all the atoms, molecules, the tafel and the elements
+  // are all cleaned when the world is destroyed
   World::destroy();
   MemoryUsageObserver::purgeInstance();
@@ -250,5 +250,5 @@
 
   // remove atom2
-  delete(atom2);
+  World::get()->destroyAtom(atom2);
 
   // check bond if removed from other atom
Index: src/unittests/manipulateAtomsTest.cpp
===================================================================
--- src/unittests/manipulateAtomsTest.cpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
+++ src/unittests/manipulateAtomsTest.cpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -0,0 +1,154 @@
+/*
+ * manipulateAtomsTest.cpp
+ *
+ *  Created on: Feb 18, 2010
+ *      Author: crueger
+ */
+
+#include "manipulateAtomsTest.hpp"
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+#include <iostream>
+#include <boost/bind.hpp>
+
+#include "Descriptors/AtomDescriptor.hpp"
+#include "Descriptors/AtomIdDescriptor.hpp"
+#include "Actions/ManipulateAtomsProcess.hpp"
+#include "Actions/ActionRegistry.hpp"
+
+#include "World.hpp"
+#include "atom.hpp"
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( manipulateAtomsTest );
+
+// some stubs
+class AtomStub : public atom {
+public:
+  AtomStub(int _id) :
+  atom(),
+  id(_id),
+  manipulated(false)
+  {}
+
+  virtual int getId(){
+    return id;
+  }
+
+  virtual void doSomething(){
+    manipulated = true;
+  }
+
+  bool manipulated;
+private:
+  int id;
+};
+
+class countObserver : public Observer{
+public:
+  countObserver() :
+    count(0)
+    {}
+  virtual ~countObserver(){}
+
+  void update(Observable *){
+    count++;
+  }
+
+  void subjectKilled(Observable *)
+  {}
+
+  int count;
+};
+
+// set up and tear down
+void manipulateAtomsTest::setUp(){
+  World::get();
+  for(int i=0;i<ATOM_COUNT;++i){
+    atoms[i]= new AtomStub(i);
+    World::get()->registerAtom(atoms[i]);
+  }
+}
+void manipulateAtomsTest::tearDown(){
+  World::destroy();
+  ActionRegistry::purgeRegistry();
+}
+
+// some helper functions
+static bool hasAll(std::vector<atom*> atoms,int min, int max, std::set<int> excluded = std::set<int>()){
+  for(int i=min;i<max;++i){
+    if(!excluded.count(i)){
+      std::vector<atom*>::iterator iter;
+      bool res=false;
+      for(iter=atoms.begin();iter!=atoms.end();++iter){
+        res |= (*iter)->getId() == i;
+      }
+      if(!res) {
+        cout << "Atom " << i << " missing in returned list" << endl;
+        return false;
+      }
+    }
+  }
+  return true;
+}
+
+static bool hasNoDuplicates(std::vector<atom*> atoms){
+  std::set<int> found;
+  std::vector<atom*>::iterator iter;
+  for(iter=atoms.begin();iter!=atoms.end();++iter){
+    int id = (*iter)->getId();
+    if(found.count(id))
+      return false;
+    found.insert(id);
+  }
+  return true;
+}
+
+static void operation(atom* _atom){
+  AtomStub *atom = dynamic_cast<AtomStub*>(_atom);
+  assert(atom);
+  atom->doSomething();
+}
+
+
+void manipulateAtomsTest::testManipulateSimple(){
+  ManipulateAtomsProcess *proc = World::get()->manipulateAtoms(boost::bind(operation,_1),"FOO",AllAtoms());
+  proc->call();
+  std::vector<atom*> allAtoms = World::get()->getAllAtoms(AllAtoms());
+  std::vector<atom*>::iterator iter;
+  for(iter=allAtoms.begin();iter!=allAtoms.end();++iter){
+    AtomStub *atom;
+    atom = dynamic_cast<AtomStub*>(*iter);
+    assert(atom);
+    CPPUNIT_ASSERT(atom->manipulated);
+  }
+}
+
+void manipulateAtomsTest::testManipulateExcluded(){
+  ManipulateAtomsProcess *proc = World::get()->manipulateAtoms(boost::bind(operation,_1),"FOO",AllAtoms() && !AtomById(ATOM_COUNT/2));
+  proc->call();
+  std::vector<atom*> allAtoms = World::get()->getAllAtoms(AllAtoms());
+  std::vector<atom*>::iterator iter;
+  for(iter=allAtoms.begin();iter!=allAtoms.end();++iter){
+    AtomStub *atom;
+    atom = dynamic_cast<AtomStub*>(*iter);
+    assert(atom);
+    if(atom->getId()!=(int)ATOM_COUNT/2)
+      CPPUNIT_ASSERT(atom->manipulated);
+    else
+      CPPUNIT_ASSERT(!atom->manipulated);
+  }
+}
+
+void manipulateAtomsTest::testObserver(){
+  countObserver *obs = new countObserver();
+  World::get()->signOn(obs);
+  ManipulateAtomsProcess *proc = World::get()->manipulateAtoms(boost::bind(operation,_1),"FOO",AllAtoms() && !AtomById(ATOM_COUNT/2));
+  proc->call();
+
+  CPPUNIT_ASSERT_EQUAL(1,obs->count);
+  World::get()->signOff(obs);
+  delete obs;
+}
Index: src/unittests/manipulateAtomsTest.hpp
===================================================================
--- src/unittests/manipulateAtomsTest.hpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
+++ src/unittests/manipulateAtomsTest.hpp	(revision a1510d5b76a932257363ed507f59a28cd93e9924)
@@ -0,0 +1,37 @@
+/*
+ * manipulateAtomsTest.hpp
+ *
+ *  Created on: Feb 18, 2010
+ *      Author: crueger
+ */
+
+#ifndef MANIPULATEATOMSTEST_HPP_
+#define MANIPULATEATOMSTEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#define ATOM_COUNT (10)
+
+class atom;
+
+class manipulateAtomsTest : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE( manipulateAtomsTest );
+  CPPUNIT_TEST ( testManipulateSimple );
+  CPPUNIT_TEST ( testManipulateExcluded );
+  CPPUNIT_TEST ( testObserver );
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+  void setUp();
+  void tearDown();
+
+  void testManipulateSimple();
+  void testManipulateExcluded();
+  void testObserver();
+
+private:
+  atom *atoms [ATOM_COUNT];
+};
+
+#endif /* MANIPULATEATOMSTEST_HPP_ */
