Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision b6b3b2db19444a7431f85964bdb2550a87243367)
+++ src/Actions/Makefile.am	(revision 528b3e649ba6df7f9bb48df7750426f110ae4f92)
@@ -21,4 +21,5 @@
   RedoAction.cpp \
   UndoAction.cpp \
+  Values.cpp \
   ValueStorage.cpp
 
@@ -35,6 +36,6 @@
   ${TESSELATIONACTIONHEADER} \
   ${WORLDACTIONHEADER} \
-  ValueStorage.hpp \
-  Values.hpp
+  Values.hpp \
+  ValueStorage.hpp
   
 ANALYSISACTIONSOURCE = \
Index: src/Actions/Values.cpp
===================================================================
--- src/Actions/Values.cpp	(revision 528b3e649ba6df7f9bb48df7750426f110ae4f92)
+++ src/Actions/Values.cpp	(revision 528b3e649ba6df7f9bb48df7750426f110ae4f92)
@@ -0,0 +1,54 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * Values.cpp
+ *
+ *  Created on: Feb 10, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "CodePatterns/Assert.hpp"
+
+#include "LinearAlgebra/BoxVector.hpp"
+#include "LinearAlgebra/RealSpaceMatrix.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "Box.hpp"
+
+#include "Values.hpp"
+
+Vector VectorValue::toVector() const
+{
+  Vector returnVector(vector);
+
+  return returnVector;
+}
+
+BoxVector VectorValue::toBoxVector(Box &_box) const
+{
+  BoxVector returnVector;
+  static_cast<Vector>(returnVector) = Vector(vector); // under its hood it's still a Vector
+
+  ASSERT(_box.isInside(returnVector),
+      "VectorValue::toBoxVector() - vector "+toString(toVector())+" does not lie within box "+toString(_box)+".");
+
+  return returnVector;
+}
+
+Box BoxValue::toBox() const
+{
+  Box returnBox(ReturnFullMatrixforSymmetric(matrix));
+
+  return returnBox;
+}
Index: src/Actions/Values.hpp
===================================================================
--- src/Actions/Values.hpp	(revision b6b3b2db19444a7431f85964bdb2550a87243367)
+++ src/Actions/Values.hpp	(revision 528b3e649ba6df7f9bb48df7750426f110ae4f92)
@@ -14,20 +14,32 @@
 #endif
 
+#include "Helpers/defs.hpp"
 
+class Box;
+class BoxVector;
+class Vector;
+
+/** This is just a temporary container for values parsed from the command line.
+ * I.e. this is only used within CommandLineParser, where VectorType and alikes
+ * are registered as VectorValue and lateron inside the CommandLineQuery placed
+ * into the real vector.
+ */
 struct VectorValue
 {
-  double x;
-  double y;
-  double z;
+  double vector[NDIM];
+
+  Vector toVector() const;
+  BoxVector toBoxVector(Box &_box) const;
 };
 
+/** This is just a temporary container for values parsed from the command line.
+ * I.e. this is only used within CommandLineParser, where BoxType is registered
+ * as BoxValue and lateron inside the CommandLineQuery placed into the real Box.
+ */
 struct BoxValue
 {
-  double xx;
-  double yx;
-  double yy;
-  double zx;
-  double zy;
-  double zz;
+  double matrix[(NDIM*(NDIM+1))/2];
+
+  Box toBox() const;
 };
 
Index: src/Box.cpp
===================================================================
--- src/Box.cpp	(revision b6b3b2db19444a7431f85964bdb2550a87243367)
+++ src/Box.cpp	(revision 528b3e649ba6df7f9bb48df7750426f110ae4f92)
@@ -38,9 +38,9 @@
 using namespace std;
 
-Box::Box()
-{
-  M= new RealSpaceMatrix();
+Box::Box() :
+    M(new RealSpaceMatrix()),
+    Minv(new RealSpaceMatrix())
+{
   M->setIdentity();
-  Minv = new RealSpaceMatrix();
   Minv->setIdentity();
   conditions.resize(3);
@@ -48,8 +48,16 @@
 }
 
-Box::Box(const Box& src){
-  M=new RealSpaceMatrix(*src.M);
-  Minv = new RealSpaceMatrix(*src.Minv);
-  conditions = src.conditions;
+Box::Box(const Box& src) :
+  conditions(src.conditions),
+  M(new RealSpaceMatrix(*src.M)),
+  Minv(new RealSpaceMatrix(*src.Minv))
+{}
+
+Box::Box(RealSpaceMatrix _M) :
+    M(new RealSpaceMatrix(_M)),
+    Minv(new RealSpaceMatrix())
+{
+  ASSERT(M->determinant()!=0,"Matrix in Box construction was not invertible");
+  *Minv = M->invert();
 }
 
@@ -295,2 +303,8 @@
   return *this;
 }
+
+ostream & operator << (ostream& ost, const Box &m)
+{
+  ost << m.getM();
+  return ost;
+}
Index: src/Box.hpp
===================================================================
--- src/Box.hpp	(revision b6b3b2db19444a7431f85964bdb2550a87243367)
+++ src/Box.hpp	(revision 528b3e649ba6df7f9bb48df7750426f110ae4f92)
@@ -45,4 +45,5 @@
   Box();
   Box(const Box&);
+  Box(RealSpaceMatrix _M);
   virtual ~Box();
 
@@ -126,3 +127,5 @@
 };
 
+ostream & operator << (ostream& ost, const Box &m);
+
 #endif /* BOX_HPP_ */
Index: src/UIElements/CommandLineUI/CommandLineParser_validate.cpp
===================================================================
--- src/UIElements/CommandLineUI/CommandLineParser_validate.cpp	(revision b6b3b2db19444a7431f85964bdb2550a87243367)
+++ src/UIElements/CommandLineUI/CommandLineParser_validate.cpp	(revision 528b3e649ba6df7f9bb48df7750426f110ae4f92)
@@ -79,7 +79,6 @@
 #endif
   }
-  VV.x = boost::lexical_cast<double>(components.at(0));
-  VV.y = boost::lexical_cast<double>(components.at(1));
-  VV.z = boost::lexical_cast<double>(components.at(2));
+  for (size_t i=0;i<NDIM;++i)
+    VV.vector[i] = boost::lexical_cast<double>(components.at(i));
   v = boost::any(VectorValue(VV));
 }
@@ -129,10 +128,6 @@
 #endif
   }
-  BV.xx = boost::lexical_cast<double>(components.at(0));
-  BV.yx = boost::lexical_cast<double>(components.at(1));
-  BV.yy = boost::lexical_cast<double>(components.at(2));
-  BV.zx = boost::lexical_cast<double>(components.at(3));
-  BV.zy = boost::lexical_cast<double>(components.at(4));
-  BV.zz = boost::lexical_cast<double>(components.at(5));
+  for (size_t i=0;i<(NDIM*(NDIM+1))/2; ++i)
+    BV.matrix[i] = boost::lexical_cast<double>(components.at(i));
   v = boost::any(BoxValue(BV));
 }
Index: src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp	(revision b6b3b2db19444a7431f85964bdb2550a87243367)
+++ src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp	(revision 528b3e649ba6df7f9bb48df7750426f110ae4f92)
@@ -38,15 +38,5 @@
   if (CommandLineParser::getInstance().vm.count(getTitle())) {
     temp = CommandLineParser::getInstance().vm[getTitle()].as< BoxValue >();
-    RealSpaceMatrix M;
-    M.set(0,0, temp.xx);
-    M.set(0,1, temp.yx);
-    M.set(0,2, temp.zx);
-    M.set(1,0, temp.yx);
-    M.set(1,1, temp.yy);
-    M.set(1,2, temp.zy);
-    M.set(2,0, temp.zx);
-    M.set(2,1, temp.zy);
-    M.set(2,2, temp.zz);
-    tmp.setM(M);
+    tmp = temp.toBox();
     return true;
   } else {
Index: src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp	(revision b6b3b2db19444a7431f85964bdb2550a87243367)
+++ src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp	(revision 528b3e649ba6df7f9bb48df7750426f110ae4f92)
@@ -40,7 +40,5 @@
   if (CommandLineParser::getInstance().vm.count(getTitle())) {
     temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >();
-    tmp[0] = temp.x;
-    tmp[1] = temp.y;
-    tmp[2] = temp.z;
+    tmp = temp.toVector();
     if ((check) && (!World::getInstance().getDomain().isInside(tmp))) {
       DoeLog(1) && (eLog() << Verbose(1) << "Vector " << tmp << " would be outside of box domain." << endl);
Index: src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp	(revision b6b3b2db19444a7431f85964bdb2550a87243367)
+++ src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp	(revision 528b3e649ba6df7f9bb48df7750426f110ae4f92)
@@ -41,7 +41,5 @@
     temporary = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<VectorValue> >();
     for(std::vector<VectorValue>::iterator iter = temporary.begin(); iter != temporary.end(); ++iter) {
-      temp[0] = (*iter).x;
-      temp[1] = (*iter).y;
-      temp[2] = (*iter).z;
+      temp = (*iter).toVector();
       if ((!check) || (World::getInstance().getDomain().isInside(temp)))
         tmp.push_back(temp);
