Index: src/Actions/WorldAction/AddEmptyBoundaryAction.cpp
===================================================================
--- src/Actions/WorldAction/AddEmptyBoundaryAction.cpp	(revision 5108e1ee1cf9c498299f8b2bf556d3a3275459c6)
+++ src/Actions/WorldAction/AddEmptyBoundaryAction.cpp	(revision 84c494528bbd3943769972df639fbc01ec0bed4e)
@@ -41,5 +41,5 @@
   int j=0;
 
-  dialog->queryVector(NAME, &boundary, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryVector(NAME, &boundary, false, MapOfActions::getInstance().getDescription(NAME));
 
   if(dialog->display()) {
@@ -59,5 +59,5 @@
     }
     // set new box size
-    double * const cell_size = World::getInstance().getDomain();
+    double * const cell_size = new double[6];
     for (j=0;j<6;j++)
       cell_size[j] = 0.;
@@ -67,4 +67,6 @@
       cell_size[j] = (Max[i]-Min[i]+2.*boundary[i]);
     }
+    World::getInstance().setDomain(cell_size);
+    delete[] cell_size;
     // translate all atoms, such that Min is aty (0,0,0)
     AtomRunner = AllAtoms.begin();
Index: src/Actions/WorldAction/CenterInBoxAction.cpp
===================================================================
--- src/Actions/WorldAction/CenterInBoxAction.cpp	(revision 5108e1ee1cf9c498299f8b2bf556d3a3275459c6)
+++ src/Actions/WorldAction/CenterInBoxAction.cpp	(revision 84c494528bbd3943769972df639fbc01ec0bed4e)
@@ -34,5 +34,5 @@
   Dialog *dialog = UIFactory::getInstance().makeDialog();
 
-  double * cell_size = World::getInstance().getDomain();
+  Box& cell_size = World::getInstance().getDomain();
   dialog->queryBox(NAME, &cell_size, MapOfActions::getInstance().getDescription(NAME));
 
Index: src/Actions/WorldAction/CenterOnEdgeAction.cpp
===================================================================
--- src/Actions/WorldAction/CenterOnEdgeAction.cpp	(revision 5108e1ee1cf9c498299f8b2bf556d3a3275459c6)
+++ src/Actions/WorldAction/CenterOnEdgeAction.cpp	(revision 84c494528bbd3943769972df639fbc01ec0bed4e)
@@ -13,4 +13,5 @@
 #include "vector.hpp"
 #include "World.hpp"
+#include "Matrix.hpp"
 
 #include <iostream>
@@ -37,5 +38,4 @@
   Vector Min;
   Vector Max;
-  int j=0;
 
   dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
@@ -57,12 +57,12 @@
     }
     // set new box size
-    double * const cell_size = World::getInstance().getDomain();
-    for (j=0;j<6;j++)
-      cell_size[j] = 0.;
-    j=-1;
+    Matrix domain;
     for (int i=0;i<NDIM;i++) {
-      j += i+1;
-      cell_size[j] = (Max[i]-Min[i]);
+      double tmp = Max[i]-Min[i];
+      tmp = fabs(tmp)>=1. ? tmp : 1.0;
+      domain.at(i,i) = tmp;
     }
+    cout << "new domain is: " << domain << endl;
+    World::getInstance().setDomain(domain);
     // translate all atoms, such that Min is aty (0,0,0)
     for (vector<atom*>::iterator AtomRunner = AllAtoms.begin(); AtomRunner != AllAtoms.end(); ++AtomRunner)
Index: src/Actions/WorldAction/ChangeBoxAction.cpp
===================================================================
--- src/Actions/WorldAction/ChangeBoxAction.cpp	(revision 5108e1ee1cf9c498299f8b2bf556d3a3275459c6)
+++ src/Actions/WorldAction/ChangeBoxAction.cpp	(revision 84c494528bbd3943769972df639fbc01ec0bed4e)
@@ -12,4 +12,5 @@
 #include "verbose.hpp"
 #include "World.hpp"
+#include "Box.hpp"
 
 #include <iostream>
@@ -34,9 +35,9 @@
   Dialog *dialog = UIFactory::getInstance().makeDialog();
 
-  double * cell_size = World::getInstance().getDomain();
+  Box& cell_size = World::getInstance().getDomain();
   dialog->queryBox(NAME, &cell_size, MapOfActions::getInstance().getDescription(NAME));
 
   if(dialog->display()) {
-    DoLog(0) && (Log() << Verbose(0) << "Setting box domain to " << cell_size[0] << "," << cell_size[1] << "," << cell_size[2] << "," << cell_size[3] << "," << cell_size[4] << "," << cell_size[5] << "," << endl);
+    DoLog(0) && (Log() << Verbose(0) << "Setting box domain to " << cell_size.getM() << endl);
     delete dialog;
     return Action::success;
Index: src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp
===================================================================
--- src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp	(revision 5108e1ee1cf9c498299f8b2bf556d3a3275459c6)
+++ src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp	(revision 84c494528bbd3943769972df639fbc01ec0bed4e)
@@ -41,5 +41,5 @@
 
   dialog->queryDouble(NAME, &radius, MapOfActions::getInstance().getDescription(NAME));
-  dialog->queryVector("position", &point, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription("position"));
+  dialog->queryVector("position", &point, false, MapOfActions::getInstance().getDescription("position"));
 
   if(dialog->display()) {
Index: src/Actions/WorldAction/RepeatBoxAction.cpp
===================================================================
--- src/Actions/WorldAction/RepeatBoxAction.cpp	(revision 5108e1ee1cf9c498299f8b2bf556d3a3275459c6)
+++ src/Actions/WorldAction/RepeatBoxAction.cpp	(revision 84c494528bbd3943769972df639fbc01ec0bed4e)
@@ -16,4 +16,5 @@
 #include "verbose.hpp"
 #include "World.hpp"
+#include "Box.hpp"
 
 #include <iostream>
@@ -47,5 +48,5 @@
   MoleculeListClass *molecules = World::getInstance().getMolecules();
 
-  dialog->queryVector(NAME, &Repeater, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryVector(NAME, &Repeater, false, MapOfActions::getInstance().getDescription(NAME));
   //dialog->queryMolecule("molecule-by-id", &mol,MapOfActions::getInstance().getDescription("molecule-by-id"));
   vector<molecule *> AllMolecules;
@@ -60,6 +61,6 @@
   if(dialog->display()) {
     (cout << "Repeating box " << Repeater << " times for (x,y,z) axis." << endl);
-    double * const cell_size = World::getInstance().getDomain();
-    Matrix M = ReturnFullMatrixforSymmetric(cell_size);
+    const Matrix &M = World::getInstance().getDomain().getM();
+    Matrix newM = M;
     Vector x,y;
     int n[NDIM];
@@ -70,6 +71,7 @@
         Repeater[axis] = 1;
       }
-      cell_size[(abs(axis+1) == 2) ? 2 : ((abs(axis+2) == 3) ? 5 : 0)] *= Repeater[axis];
+      newM.at(axis,axis) *= Repeater[axis];
     }
+    World::getInstance().getDomain().setM(newM);
 
     molecule *newmol = NULL;
Index: src/Actions/WorldAction/ScaleBoxAction.cpp
===================================================================
--- src/Actions/WorldAction/ScaleBoxAction.cpp	(revision 5108e1ee1cf9c498299f8b2bf556d3a3275459c6)
+++ src/Actions/WorldAction/ScaleBoxAction.cpp	(revision 84c494528bbd3943769972df639fbc01ec0bed4e)
@@ -14,4 +14,5 @@
 #include "verbose.hpp"
 #include "World.hpp"
+#include "Box.hpp"
 
 #include <iostream>
@@ -37,7 +38,6 @@
   Vector Scaler;
   double x[NDIM];
-  int j=0;
 
-  dialog->queryVector(NAME, &Scaler, World::getInstance().getDomain(), false, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryVector(NAME, &Scaler, false, MapOfActions::getInstance().getDescription(NAME));
 
   if(dialog->display()) {
@@ -49,9 +49,8 @@
       (*AtomRunner)->x.ScaleAll(x);
     }
-    j = -1;
-    double * const cell_size = World::getInstance().getDomain();
+
+    Matrix M = World::getInstance().getDomain().getM();
     for (int i=0;i<NDIM;i++) {
-      j += i+1;
-      cell_size[j]*=x[i];
+      M.at(i,i) *= x[i];
     }
 
