Index: src/Actions/AnalysisAction/MolecularVolumeAction.cpp
===================================================================
--- src/Actions/AnalysisAction/MolecularVolumeAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/AnalysisAction/MolecularVolumeAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -60,5 +60,4 @@
     LCList = new LinkedCell(mol, 10.);
     config * const configuration = World::getInstance().getConfig();
-    Boundaries *BoundaryPoints = NULL;
     //FindConvexBorder(mol, BoundaryPoints, TesselStruct, LCList, argv[argptr]);
     FindNonConvexBorder(mol, TesselStruct, LCList, 5., NULL);
Index: src/Actions/AnalysisAction/PairCorrelationAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PairCorrelationAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/AnalysisAction/PairCorrelationAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -70,5 +70,4 @@
   double BinStart = 0.;
   double BinWidth = 0.;
-  molecule *Boundary = NULL;
   string outputname;
   string binoutputname;
Index: src/Actions/AnalysisAction/PointCorrelationAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PointCorrelationAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/AnalysisAction/PointCorrelationAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -71,5 +71,4 @@
   double BinStart = 0.;
   double BinWidth = 0.;
-  molecule *Boundary = NULL;
   string outputname;
   string binoutputname;
Index: src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -62,15 +62,16 @@
     // sum up inertia tensor
     for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
-      Vector x = (*iter)->x;
+      Vector x = (*iter)->getPosition();
       x -= *CenterOfGravity;
-      InertiaTensor.at(0,0) += (*iter)->type->mass*(x[1]*x[1] + x[2]*x[2]);
-      InertiaTensor.at(0,1) += (*iter)->type->mass*(-x[0]*x[1]);
-      InertiaTensor.at(0,2) += (*iter)->type->mass*(-x[0]*x[2]);
-      InertiaTensor.at(1,0) += (*iter)->type->mass*(-x[1]*x[0]);
-      InertiaTensor.at(1,1) += (*iter)->type->mass*(x[0]*x[0] + x[2]*x[2]);
-      InertiaTensor.at(1,2) += (*iter)->type->mass*(-x[1]*x[2]);
-      InertiaTensor.at(2,0) += (*iter)->type->mass*(-x[2]*x[0]);
-      InertiaTensor.at(2,1) += (*iter)->type->mass*(-x[2]*x[1]);
-      InertiaTensor.at(2,2) += (*iter)->type->mass*(x[0]*x[0] + x[1]*x[1]);
+      const double mass = (*iter)->getType()->mass;
+      InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]);
+      InertiaTensor.at(0,1) += mass*(-x[0]*x[1]);
+      InertiaTensor.at(0,2) += mass*(-x[0]*x[2]);
+      InertiaTensor.at(1,0) += mass*(-x[1]*x[0]);
+      InertiaTensor.at(1,1) += mass*(x[0]*x[0] + x[2]*x[2]);
+      InertiaTensor.at(1,2) += mass*(-x[1]*x[2]);
+      InertiaTensor.at(2,0) += mass*(-x[2]*x[0]);
+      InertiaTensor.at(2,1) += mass*(-x[2]*x[1]);
+      InertiaTensor.at(2,2) += mass*(x[0]*x[0] + x[1]*x[1]);
     }
     // print InertiaTensor for debugging
Index: src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp
===================================================================
--- src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -111,5 +111,4 @@
   // find biggest molecule
   std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules();
-  int counter  = molecules.size();
   LCList = new LinkedCell(Boundary, LCWidth);
   FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL);
Index: src/Actions/AtomAction/AddAction.cpp
===================================================================
--- src/Actions/AtomAction/AddAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/AtomAction/AddAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -61,7 +61,7 @@
   // execute action
   atom * first = World::getInstance().createAtom();
-  first->type = elemental;
-  first->x = position;
-  DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->type->name << " at " << (first->x) << "." << endl);
+  first->setType(elemental);
+  first->setPosition(position);
+  DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << first->getType()->name << " at " << (first->getPosition()) << "." << endl);
   // TODO: remove when all of World's atoms are stored.
   std::vector<molecule *> molecules = World::getInstance().getAllMolecules();
Index: src/Actions/AtomAction/ChangeElementAction.cpp
===================================================================
--- src/Actions/AtomAction/ChangeElementAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/AtomAction/ChangeElementAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -61,5 +61,5 @@
     mol = first->getMolecule();
     first->removeFromMolecule(); // remove atom
-    first->type = elemental;
+    first->setType(elemental);
     mol->AddAtom(first);  // add atom to ensure correctness of formula
   }
Index: src/Actions/FragmentationAction/SubgraphDissectionAction.cpp
===================================================================
--- src/Actions/FragmentationAction/SubgraphDissectionAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/FragmentationAction/SubgraphDissectionAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -10,9 +10,12 @@
 #include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
 #include "Actions/ActionRegistry.hpp"
+#include "Descriptors/MoleculeDescriptor.hpp"
+
 #include "atom.hpp"
+#include "bond.hpp"
+#include "bondgraph.hpp"
 #include "config.hpp"
 #include "Helpers/Log.hpp"
 #include "molecule.hpp"
-#include "Descriptors/MoleculeDescriptor.hpp"
 #include "stackclass.hpp"
 #include "World.hpp"
@@ -53,5 +56,102 @@
   // @TODO rather do the dissection afterwards
   MoleculeListClass *molecules = World::getInstance().getMolecules();
-  molecules->DissectMoleculeIntoConnectedSubgraphs(World::getInstance().getPeriode(), World::getInstance().getConfig());
+  config * const configuration = World::getInstance().getConfig();
+
+  // 0a. remove all present molecules
+  vector<molecule *> allmolecules = World::getInstance().getAllMolecules();
+  for (vector<molecule *>::iterator MolRunner = allmolecules.begin(); MolRunner != allmolecules.end(); ++MolRunner) {
+    molecules->erase(*MolRunner);
+    World::getInstance().destroyMolecule(*MolRunner);
+  }
+
+  // 0b. remove all bonds and construct a molecule with all atoms
+  molecule *mol = World::getInstance().createMolecule();
+  vector <atom *> allatoms = World::getInstance().getAllAtoms();
+  for(vector<atom *>::iterator AtomRunner = allatoms.begin(); AtomRunner != allatoms.end(); ++AtomRunner) {
+    for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); !(*AtomRunner)->ListOfBonds.empty(); BondRunner = (*AtomRunner)->ListOfBonds.begin())
+      delete(*BondRunner);
+    mol->AddAtom(*AtomRunner);
+  }
+
+  // 1. create the bond structure of the single molecule
+  if (configuration->BG != NULL) {
+    if (!configuration->BG->ConstructBondGraph(mol)) {
+      World::getInstance().destroyMolecule(mol);
+      DoeLog(1) && (eLog()<< Verbose(1) << "There are no bonds." << endl);
+      return Action::failure;
+    }
+  } else {
+    DoeLog(1) && (eLog()<< Verbose(1) << "There is no BondGraph class present to create bonds." << endl);
+    return Action::failure;
+  }
+
+  // 2. scan for connected subgraphs
+  MoleculeLeafClass *Subgraphs = NULL;      // list of subgraphs from DFS analysis
+  class StackClass<bond *> *BackEdgeStack = NULL;
+  Subgraphs = mol->DepthFirstSearchAnalysis(BackEdgeStack);
+  delete(BackEdgeStack);
+  if ((Subgraphs == NULL) || (Subgraphs->next == NULL)) {
+    World::getInstance().destroyMolecule(mol);
+    DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms." << endl);
+    return Action::failure;
+  }
+
+  // 3. dissect (the following construct is needed to have the atoms not in the order of the DFS, but in
+  // the original one as parsed in)
+  // TODO: Optimize this, when molecules just contain pointer list of global atoms!
+
+  // 4a. create array of molecules to fill
+  const int MolCount = Subgraphs->next->Count();
+  char number[MAXSTRINGSIZE];
+  molecule **moleculelist = new molecule *[MolCount];
+  MoleculeLeafClass *MolecularWalker = Subgraphs;
+  for (int i=0;i<MolCount;i++) {
+    MolecularWalker = MolecularWalker->next;
+    moleculelist[i] = World::getInstance().createMolecule();
+    moleculelist[i]->ActiveFlag = true;
+    strncpy(moleculelist[i]->name, mol->name, MAXSTRINGSIZE);
+    if (MolCount > 1) {
+      sprintf(number, "-%d", i+1);
+      strncat(moleculelist[i]->name, number, MAXSTRINGSIZE - strlen(mol->name) - 1);
+    }
+    DoLog(1) && (Log() << Verbose(1) << "MolName is " << moleculelist[i]->name << ", id is " << moleculelist[i]->getId() << endl);
+    for (molecule::iterator iter = MolecularWalker->Leaf->begin(); iter != MolecularWalker->Leaf->end(); ++iter) {
+      DoLog(1) && (Log() << Verbose(1) << **iter << endl);
+    }
+    molecules->insert(moleculelist[i]);
+  }
+
+  // 4b. create and fill map of which atom is associated to which connected molecule (note, counting starts at 1)
+  int FragmentCounter = 0;
+  map<int, atom *> AtomToFragmentMap;
+  MolecularWalker = Subgraphs;
+  while (MolecularWalker->next != NULL) {
+    MolecularWalker = MolecularWalker->next;
+    for (molecule::iterator iter = MolecularWalker->Leaf->begin(); !MolecularWalker->Leaf->empty(); iter = MolecularWalker->Leaf->begin()) {
+      atom * Walker = *iter;
+      DoLog(1) && (Log() << Verbose(1) << "Re-linking " << Walker << "..." << endl);
+      MolecularWalker->Leaf->erase(iter);
+      moleculelist[FragmentCounter]->AddAtom(Walker);    // counting starts at 1
+    }
+    FragmentCounter++;
+  }
+  // TODO: When DepthFirstSearchAnalysis does not use AddCopyAtom() anymore, we don't need to delete all original atoms.
+  // 4d. destroy the original molecule
+  for (molecule::iterator AtomRunner = mol->begin(); !mol->empty(); AtomRunner = mol->begin())
+    World::getInstance().destroyAtom(*AtomRunner);
+  World::getInstance().destroyMolecule(mol);
+
+  // 4d. we don't need to redo bonds, as they are connected subgraphs and still maintain their ListOfBonds, but we have to remove them from first..last list
+  // TODO: check whether this is really not needed anymore
+  // 4e. free Leafs
+  MolecularWalker = Subgraphs;
+  while (MolecularWalker->next != NULL) {
+    MolecularWalker = MolecularWalker->next;
+    delete(MolecularWalker->previous);
+  }
+  delete(MolecularWalker);
+  delete[](moleculelist);
+  DoLog(1) && (Log() << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl);
+
   return Action::success;
 }
Index: src/Actions/MoleculeAction/RotateAroundOriginByAngleAction.cpp
===================================================================
--- src/Actions/MoleculeAction/RotateAroundOriginByAngleAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/MoleculeAction/RotateAroundOriginByAngleAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -91,5 +91,5 @@
 
     for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
-      *((*iter)->node) = RotationAxis.rotateVector(*((*iter)->node), alpha);
+      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), alpha));
     }
   }
@@ -109,5 +109,5 @@
 
     for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
-      *((*iter)->node) = RotationAxis.rotateVector(*((*iter)->node), -state->alpha);
+      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), -state->alpha));
     }
   }
@@ -127,5 +127,5 @@
 
     for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
-      *((*iter)->node) = RotationAxis.rotateVector(*((*iter)->node), state->alpha);
+      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), state->alpha));
     }
   }
Index: src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp
===================================================================
--- src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -96,5 +96,5 @@
 
   for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
-    *((*iter)->node) = RotationAxis.rotateVector(*((*iter)->node), alpha);
+    (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), alpha));
   }
   DoLog(0) && (Log() << Verbose(0) << "done." << endl);
@@ -111,5 +111,5 @@
 
   for (molecule::iterator iter = state->mol->begin(); iter != state->mol->end(); ++iter) {
-    *((*iter)->node) = RotationAxis.rotateVector(*((*iter)->node), -state->alpha);
+    (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), -state->alpha));
   }
 
@@ -125,5 +125,5 @@
 
   for (molecule::iterator iter = state->mol->begin(); iter != state->mol->end(); ++iter) {
-    *((*iter)->node) = RotationAxis.rotateVector(*((*iter)->node), state->alpha);
+    (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), state->alpha));
   }
 
Index: src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp
===================================================================
--- src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -83,15 +83,16 @@
     // sum up inertia tensor
     for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
-      Vector x = (*iter)->x;
+      Vector x = (*iter)->getPosition();
       x -= *CenterOfGravity;
-      InertiaTensor.at(0,0) += (*iter)->type->mass*(x[1]*x[1] + x[2]*x[2]);
-      InertiaTensor.at(0,1) += (*iter)->type->mass*(-x[0]*x[1]);
-      InertiaTensor.at(0,2) += (*iter)->type->mass*(-x[0]*x[2]);
-      InertiaTensor.at(1,0) += (*iter)->type->mass*(-x[1]*x[0]);
-      InertiaTensor.at(1,1) += (*iter)->type->mass*(x[0]*x[0] + x[2]*x[2]);
-      InertiaTensor.at(1,2) += (*iter)->type->mass*(-x[1]*x[2]);
-      InertiaTensor.at(2,0) += (*iter)->type->mass*(-x[2]*x[0]);
-      InertiaTensor.at(2,1) += (*iter)->type->mass*(-x[2]*x[1]);
-      InertiaTensor.at(2,2) += (*iter)->type->mass*(x[0]*x[0] + x[1]*x[1]);
+      const double mass = (*iter)->getType()->mass;
+      InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]);
+      InertiaTensor.at(0,1) += mass*(-x[0]*x[1]);
+      InertiaTensor.at(0,2) += mass*(-x[0]*x[2]);
+      InertiaTensor.at(1,0) += mass*(-x[1]*x[0]);
+      InertiaTensor.at(1,1) += mass*(x[0]*x[0] + x[2]*x[2]);
+      InertiaTensor.at(1,2) += mass*(-x[1]*x[2]);
+      InertiaTensor.at(2,0) += mass*(-x[2]*x[0]);
+      InertiaTensor.at(2,1) += mass*(-x[2]*x[1]);
+      InertiaTensor.at(2,2) += mass*(x[0]*x[0] + x[1]*x[1]);
     }
     // print InertiaTensor for debugging
@@ -121,7 +122,7 @@
 
     for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
-      *((*iter)->node) -= *CenterOfGravity;
-      *((*iter)->node) = RotationAxis.rotateVector(*((*iter)->node), alpha);
-      *((*iter)->node) += *CenterOfGravity;
+      *(*iter) -= *CenterOfGravity;
+      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), alpha));
+      *(*iter) += *CenterOfGravity;
     }
     DoLog(0) && (Log() << Verbose(0) << "done." << endl);
@@ -133,15 +134,16 @@
     // sum up inertia tensor
     for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
-      Vector x = (*iter)->x;
+      Vector x = (*iter)->getPosition();
       x -= *CenterOfGravity;
-      InertiaTensor.at(0,0) += (*iter)->type->mass*(x[1]*x[1] + x[2]*x[2]);
-      InertiaTensor.at(0,1) += (*iter)->type->mass*(-x[0]*x[1]);
-      InertiaTensor.at(0,2) += (*iter)->type->mass*(-x[0]*x[2]);
-      InertiaTensor.at(1,0) += (*iter)->type->mass*(-x[1]*x[0]);
-      InertiaTensor.at(1,1) += (*iter)->type->mass*(x[0]*x[0] + x[2]*x[2]);
-      InertiaTensor.at(1,2) += (*iter)->type->mass*(-x[1]*x[2]);
-      InertiaTensor.at(2,0) += (*iter)->type->mass*(-x[2]*x[0]);
-      InertiaTensor.at(2,1) += (*iter)->type->mass*(-x[2]*x[1]);
-      InertiaTensor.at(2,2) += (*iter)->type->mass*(x[0]*x[0] + x[1]*x[1]);
+      const double mass = (*iter)->getType()->mass;
+      InertiaTensor.at(0,0) += mass*(x[1]*x[1] + x[2]*x[2]);
+      InertiaTensor.at(0,1) += mass*(-x[0]*x[1]);
+      InertiaTensor.at(0,2) += mass*(-x[0]*x[2]);
+      InertiaTensor.at(1,0) += mass*(-x[1]*x[0]);
+      InertiaTensor.at(1,1) += mass*(x[0]*x[0] + x[2]*x[2]);
+      InertiaTensor.at(1,2) += mass*(-x[1]*x[2]);
+      InertiaTensor.at(2,0) += mass*(-x[2]*x[0]);
+      InertiaTensor.at(2,1) += mass*(-x[2]*x[1]);
+      InertiaTensor.at(2,2) += mass*(x[0]*x[0] + x[1]*x[1]);
       // print InertiaTensor for debugging
       DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << InertiaTensor << endl);
Index: src/Actions/TesselationAction/ConvexEnvelopeAction.cpp
===================================================================
--- src/Actions/TesselationAction/ConvexEnvelopeAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/TesselationAction/ConvexEnvelopeAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -84,5 +84,4 @@
     DoLog(1) && (Log() << Verbose(1) << "Storing tecplot non-convex data in " << filenameNonConvex << "." << endl);
     LCList = new LinkedCell(mol, 100.);
-    Boundaries *BoundaryPoints = NULL;
     //FindConvexBorder(mol, BoundaryPoints, TesselStruct, LCList, argv[argptr]);
     // TODO: Beide Funktionen sollten streams anstelle des Filenamen benutzen, besser fuer unit tests
Index: src/Actions/WorldAction/AddEmptyBoundaryAction.cpp
===================================================================
--- src/Actions/WorldAction/AddEmptyBoundaryAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/WorldAction/AddEmptyBoundaryAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -60,12 +60,12 @@
   ASSERT(AllAtoms.size() > 0, "There must be atoms present for AddingEmptyBoundary.");
   vector<atom *>::iterator AtomRunner = AllAtoms.begin();
-  Min = (*AtomRunner)->x;
-  Max = (*AtomRunner)->x;
+  Min = (*AtomRunner)->getPosition();
+  Max = (*AtomRunner)->getPosition();
   for (; AtomRunner != AllAtoms.end(); ++AtomRunner) {
     for (int i=0;i<NDIM;i++) {
-      if ((*AtomRunner)->x[i] > Max[i])
-        Max[i] = (*AtomRunner)->x[i];
-      if ((*AtomRunner)->x[i] < Min[i])
-        Min[i] = (*AtomRunner)->x[i];
+      if ((*AtomRunner)->at(i) > Max[i])
+        Max[i] = (*AtomRunner)->at(i);
+      if ((*AtomRunner)->at(i) < Min[i])
+        Min[i] = (*AtomRunner)->at(i);
     }
   }
@@ -84,5 +84,5 @@
   AtomRunner = AllAtoms.begin();
   for (; AtomRunner != AllAtoms.end(); ++AtomRunner)
-    (*AtomRunner)->x -= Min - boundary;
+    *(*AtomRunner) -= Min - boundary;
   return Action::success;
 }
Index: src/Actions/WorldAction/CenterOnEdgeAction.cpp
===================================================================
--- src/Actions/WorldAction/CenterOnEdgeAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/WorldAction/CenterOnEdgeAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -55,12 +55,12 @@
   ASSERT(AllAtoms.size() > 0, "For CenteronEdge atoms must be present.");
   vector<atom *>::iterator AtomRunner = AllAtoms.begin();
-  Min = (*AtomRunner)->x;
-  Max = (*AtomRunner)->x;
+  Min = (*AtomRunner)->getPosition();
+  Max = (*AtomRunner)->getPosition();
   for (; AtomRunner != AllAtoms.end(); ++AtomRunner) {
     for (int i=0;i<NDIM;i++) {
-      if ((*AtomRunner)->x[i] > Max[i])
-        Max[i] = (*AtomRunner)->x[i];
-      if ((*AtomRunner)->x[i] < Min[i])
-        Min[i] = (*AtomRunner)->x[i];
+      if ((*AtomRunner)->at(i) > Max[i])
+        Max[i] = (*AtomRunner)->at(i);
+      if ((*AtomRunner)->at(i) < Min[i])
+        Min[i] = (*AtomRunner)->at(i);
     }
   }
@@ -75,5 +75,5 @@
   // translate all atoms, such that Min is aty (0,0,0)
   for (vector<atom*>::iterator AtomRunner = AllAtoms.begin(); AtomRunner != AllAtoms.end(); ++AtomRunner)
-    (*AtomRunner)->x -= Min;
+    *(*AtomRunner) -= Min;
 
   return Action::success;
Index: src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp
===================================================================
--- src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -62,5 +62,6 @@
   vector<molecule *> molecules = World::getInstance().getAllMolecules();
   for (vector<atom*>::iterator AtomRunner = AllAtoms.begin(); AtomRunner != AllAtoms.end(); ++AtomRunner) {
-    if (point.DistanceSquared((*AtomRunner)->x) > radius*radius) { // distance to first above radius ...
+    if ((*AtomRunner)->DistanceSquared(point) > radius*radius) { // distance to first above radius ...
+//      cout << "Removing " << (*AtomRunner)->getType()->symbol << (*AtomRunner)->getId() << " at " << (*AtomRunner)->getPosition() << " as distance is " << sqrt((*AtomRunner)->DistanceSquared(point)) << endl;
       // TODO: This is not necessary anymore when atoms are completely handled by World (create/destroy and load/save)
       for (vector<molecule *>::iterator iter = molecules.begin();iter != molecules.end();++iter)
@@ -68,4 +69,7 @@
       World::getInstance().destroyAtom(*AtomRunner);
     }
+//    else {
+//      cout << "Keeping" << (*AtomRunner)->getType()->symbol << (*AtomRunner)->getId() << " at " << (*AtomRunner)->getPosition() << " as distance is " << sqrt((*AtomRunner)->DistanceSquared(point)) << endl;
+//    }
   }
   return Action::success;
Index: src/Actions/WorldAction/RepeatBoxAction.cpp
===================================================================
--- src/Actions/WorldAction/RepeatBoxAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/WorldAction/RepeatBoxAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -21,4 +21,5 @@
 #include <iostream>
 #include <string>
+#include <vector>
 
 using namespace std;
@@ -90,5 +91,5 @@
 
   molecule *newmol = NULL;
-  Vector ** vectors = NULL;
+  std::vector<Vector> vectors;
   for (n[0] = 0; n[0] < Repeater[0]; n[0]++) {
     y[0] = n[0];
@@ -105,9 +106,9 @@
           if (count != 0) {  // if there is more than none
             Elements = new const element *[count];
-            vectors = new Vector *[count];
+            vectors.resize(count);
             j = 0;
             for(molecule::iterator AtomRunner = mol->begin(); AtomRunner != mol->end(); ++AtomRunner) {
-              Elements[j] = (*AtomRunner)->type;
-              vectors[j] = &(*AtomRunner)->x;
+              Elements[j] = (*AtomRunner)->getType();
+              vectors[j] = (*AtomRunner)->getPosition();
               j++;
             }
@@ -120,6 +121,6 @@
             for (int k=count;k--;) { // go through every atom of the original cell
               Walker = World::getInstance().createAtom(); // create a new body
-              Walker->x = (*vectors[k]) + x;
-              Walker->type = Elements[k];  // insert original element
+              Walker->setPosition((vectors[k]) + x);
+              Walker->setType(Elements[k]);  // insert original element
               cout << "new atom is " << *Walker << endl;
               newmol->AddAtom(Walker);        // and add to the molecule (which increments ElementsInMolecule, AtomCount, ...)
@@ -127,5 +128,4 @@
             // free memory
             delete[](Elements);
-            delete[](vectors);
           } else {
             DoLog(1) && (Log() << Verbose(1) << "\t ... is empty." << endl);
Index: src/Actions/WorldAction/ScaleBoxAction.cpp
===================================================================
--- src/Actions/WorldAction/ScaleBoxAction.cpp	(revision 90bc51774be4b7f550eb9afe64fe3212c4a8abbc)
+++ src/Actions/WorldAction/ScaleBoxAction.cpp	(revision 8f4df1ef77448922e1b977a3e138bcc2a4a4dad0)
@@ -60,5 +60,5 @@
   vector<atom*> AllAtoms = World::getInstance().getAllAtoms();
   for(vector<atom*>::iterator AtomRunner = AllAtoms.begin(); AtomRunner != AllAtoms.end(); ++AtomRunner) {
-    (*AtomRunner)->x.ScaleAll(x);
+    (*AtomRunner)->ScaleAll(x);
   }
 
