Index: src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp
===================================================================
--- src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp	(revision a439e552b524ad69d77533afc340c392ecf15aab)
+++ src/Actions/AnalysisAction/PrincipalAxisSystemAction.cpp	(revision 6e5084ba8942d5b07318fb32c642c0078c9dafe5)
@@ -10,7 +10,10 @@
 #include "Actions/AnalysisAction/PrincipalAxisSystemAction.hpp"
 #include "Actions/ActionRegistry.hpp"
-#include "molecule.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Matrix.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "element.hpp"
+#include "molecule.hpp"
 
 #include <iostream>
@@ -46,4 +49,5 @@
 Action::state_ptr AnalysisPrincipalAxisSystemAction::performCall() {
   molecule *mol = NULL;
+  Matrix InertiaTensor;
 
   ValueStorage::getInstance().queryCurrentValue(NAME, mol);
@@ -51,5 +55,25 @@
   for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) {
     molecule *mol = iter->second;
-    mol->PrincipalAxisSystem(false);
+    Vector *CenterOfGravity = mol->DetermineCenterOfGravity();
+
+    // reset inertia tensor
+    InertiaTensor.zero();
+
+    // sum up inertia tensor
+    for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
+      Vector x = (*iter)->x;
+      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]);
+    }
+    // print InertiaTensor for debugging
+    DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << InertiaTensor << endl);
   }
   return Action::success;
Index: src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp
===================================================================
--- src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp	(revision a439e552b524ad69d77533afc340c392ecf15aab)
+++ src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp	(revision 6e5084ba8942d5b07318fb32c642c0078c9dafe5)
@@ -11,6 +11,10 @@
 #include "Actions/ActionRegistry.hpp"
 #include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Line.hpp"
+#include "LinearAlgebra/Matrix.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "element.hpp"
 #include "molecule.hpp"
-#include "Helpers/Verbose.hpp"
 
 
@@ -48,5 +52,6 @@
 {}
 
-void MoleculeRotateToPrincipalAxisSystem() {
+void MoleculeRotateToPrincipalAxisSystem(Vector &Axis) {
+  ValueStorage::getInstance().setCurrentValue(MoleculeRotateToPrincipalAxisSystemAction::NAME, Axis);
   ActionRegistry::getInstance().getActionByName(MoleculeRotateToPrincipalAxisSystemAction::NAME)->call(Action::NonInteractive);
 };
@@ -55,5 +60,5 @@
   ASSERT(dialog,"No Dialog given when filling action dialog");
 
-  dialog->queryEmpty(NAME, MapOfActions::getInstance().getDescription(NAME));
+  dialog->queryVector(NAME, false, MapOfActions::getInstance().getDescription(NAME));
 
   return dialog;
@@ -62,9 +67,87 @@
 Action::state_ptr MoleculeRotateToPrincipalAxisSystemAction::performCall() {
   molecule *mol = NULL;
+  Vector Axis;
+
+  // obtain axis to rotate to
+  ValueStorage::getInstance().queryCurrentValue(NAME, Axis);
 
   for (World::MoleculeSelectionIterator iter = World::getInstance().beginMoleculeSelection(); iter != World::getInstance().endMoleculeSelection(); ++iter) {
     mol = iter->second;
     DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl);
-    mol->PrincipalAxisSystem(true);
+    Matrix InertiaTensor;
+    Vector *CenterOfGravity = mol->DetermineCenterOfGravity();
+
+    // reset inertia tensor
+    InertiaTensor.zero();
+
+    // sum up inertia tensor
+    for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
+      Vector x = (*iter)->x;
+      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]);
+    }
+    // print InertiaTensor for debugging
+    DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << InertiaTensor << endl);
+
+    // diagonalize to determine principal axis system
+    Vector Eigenvalues = InertiaTensor.transformToEigenbasis();
+
+    for(int i=0;i<NDIM;i++)
+      DoLog(0) && (Log() << Verbose(0) << "eigenvalue = " << Eigenvalues[i] << ", eigenvector = " << InertiaTensor.column(i) << endl);
+
+    // check whether we rotate or not
+    DoLog(0) && (Log() << Verbose(0) << "Transforming molecule into PAS ... ");
+
+    // obtain first column, eigenvector to biggest eigenvalue
+    Vector BiggestEigenvector(InertiaTensor.column(Eigenvalues.SmallestComponent()));
+    Vector DesiredAxis(Axis);
+
+    // Creation Line that is the rotation axis
+    DesiredAxis.VectorProduct(BiggestEigenvector);
+    Line RotationAxis(Vector(0.,0.,0.), DesiredAxis);
+
+    // determine angle
+    const double alpha = BiggestEigenvector.Angle(Axis);
+
+    DoLog(0) && (Log() << Verbose(0) << alpha << endl);
+
+    for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
+      *((*iter)->node) -= *CenterOfGravity;
+      *((*iter)->node) = RotationAxis.rotateVector(*((*iter)->node), alpha);
+      *((*iter)->node) += *CenterOfGravity;
+    }
+    DoLog(0) && (Log() << Verbose(0) << "done." << endl);
+
+    // summing anew for debugging (resulting matrix has to be diagonal!)
+    // reset inertia tensor
+    InertiaTensor.zero();
+
+    // sum up inertia tensor
+    for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
+      Vector x = (*iter)->x;
+      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]);
+      // print InertiaTensor for debugging
+      DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << InertiaTensor << endl);
+    }
+
+    // free everything
+    delete(CenterOfGravity);
   }
   return Action::success;
Index: src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp
===================================================================
--- src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp	(revision a439e552b524ad69d77533afc340c392ecf15aab)
+++ src/Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp	(revision 6e5084ba8942d5b07318fb32c642c0078c9dafe5)
@@ -13,9 +13,10 @@
 
 class MoleculeListClass;
+class Vector;
 
-void MoleculeRotateToPrincipalAxisSystem();
+void MoleculeRotateToPrincipalAxisSystem(Vector &Axis);
 
 class MoleculeRotateToPrincipalAxisSystemAction : public Action {
-  friend void MoleculeRotateToPrincipalAxisSystem();
+  friend void MoleculeRotateToPrincipalAxisSystem(Vector &Axis);
 
 public:
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision a439e552b524ad69d77533afc340c392ecf15aab)
+++ src/Makefile.am	(revision 6e5084ba8942d5b07318fb32c642c0078c9dafe5)
@@ -303,5 +303,7 @@
 joiner_SOURCES = joiner.cpp datacreator.cpp datacreator.hpp periodentafel.hpp
 joiner_LDADD = \
+	Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
 	libMolecuilder-@MOLECUILDER_API_VERSION@.la \
+	Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \
 	LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \
 	Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
@@ -313,5 +315,7 @@
 analyzer_SOURCES = analyzer.cpp datacreator.cpp periodentafel.hpp datacreator.hpp 
 analyzer_LDADD = \
+	Actions/libMolecuilderActions-@MOLECUILDER_API_VERSION@.la \
 	libMolecuilder-@MOLECUILDER_API_VERSION@.la \
+	Parser/libMolecuilderParser-@MOLECUILDER_API_VERSION@.la \
 	LinearAlgebra/libMolecuilderLinearAlgebra-@MOLECUILDER_API_VERSION@.la \
 	Exceptions/libMolecuilderExceptions-@MOLECUILDER_API_VERSION@.la \
Index: src/boundary.cpp
===================================================================
--- src/boundary.cpp	(revision a439e552b524ad69d77533afc340c392ecf15aab)
+++ src/boundary.cpp	(revision 6e5084ba8942d5b07318fb32c642c0078c9dafe5)
@@ -6,4 +6,5 @@
 #include "Helpers/MemDebug.hpp"
 
+#include "Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp"
 #include "World.hpp"
 #include "atom.hpp"
@@ -674,6 +675,7 @@
   double cellvolume = 0.;
 
-  // transform to PAS
-  mol->PrincipalAxisSystem(true);
+  // transform to PAS by Action
+  Vector MainAxis(0.,0.,1.);
+  MoleculeRotateToPrincipalAxisSystem(MainAxis);
 
   IsAngstroem = configuration->GetIsAngstroem();
Index: src/molecule.hpp
===================================================================
--- src/molecule.hpp	(revision a439e552b524ad69d77533afc340c392ecf15aab)
+++ src/molecule.hpp	(revision 6e5084ba8942d5b07318fb32c642c0078c9dafe5)
@@ -278,5 +278,4 @@
   bool VerletForceIntegration(char *file, config &configuration, const size_t offset);
   void Thermostats(config &configuration, double ActualTemp, int Thermostat);
-  void PrincipalAxisSystem(bool DoRotate);
   double VolumeOfConvexEnvelope(bool IsAngstroem);
 
Index: src/molecule_geometry.cpp
===================================================================
--- src/molecule_geometry.cpp	(revision a439e552b524ad69d77533afc340c392ecf15aab)
+++ src/molecule_geometry.cpp	(revision 6e5084ba8942d5b07318fb32c642c0078c9dafe5)
@@ -10,5 +10,11 @@
 #endif
 
+#include "Helpers/helpers.hpp"
+#include "Helpers/Log.hpp"
 #include "Helpers/MemDebug.hpp"
+#include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Line.hpp"
+#include "LinearAlgebra/Matrix.hpp"
+#include "LinearAlgebra/Plane.hpp"
 
 #include "atom.hpp"
@@ -16,13 +22,10 @@
 #include "config.hpp"
 #include "element.hpp"
-#include "Helpers/helpers.hpp"
 #include "leastsquaremin.hpp"
-#include "Helpers/Verbose.hpp"
-#include "Helpers/Log.hpp"
 #include "molecule.hpp"
 #include "World.hpp"
-#include "LinearAlgebra/Plane.hpp"
-#include "LinearAlgebra/Matrix.hpp"
+
 #include "Box.hpp"
+
 #include <boost/foreach.hpp>
 
@@ -316,103 +319,4 @@
 };
 
-/** Transforms/Rotates the given molecule into its principal axis system.
- * \param *out output stream for debugging
- * \param DoRotate whether to rotate (true) or only to determine the PAS.
- * TODO treatment of trajetories missing
- */
-void molecule::PrincipalAxisSystem(bool DoRotate)
-{
-  double InertiaTensor[NDIM*NDIM];
-  Vector *CenterOfGravity = DetermineCenterOfGravity();
-
-  CenterPeriodic();
-
-  // reset inertia tensor
-  for(int i=0;i<NDIM*NDIM;i++)
-    InertiaTensor[i] = 0.;
-
-  // sum up inertia tensor
-  for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
-    Vector x = (*iter)->x;
-    //x.SubtractVector(CenterOfGravity);
-    InertiaTensor[0] += (*iter)->type->mass*(x[1]*x[1] + x[2]*x[2]);
-    InertiaTensor[1] += (*iter)->type->mass*(-x[0]*x[1]);
-    InertiaTensor[2] += (*iter)->type->mass*(-x[0]*x[2]);
-    InertiaTensor[3] += (*iter)->type->mass*(-x[1]*x[0]);
-    InertiaTensor[4] += (*iter)->type->mass*(x[0]*x[0] + x[2]*x[2]);
-    InertiaTensor[5] += (*iter)->type->mass*(-x[1]*x[2]);
-    InertiaTensor[6] += (*iter)->type->mass*(-x[2]*x[0]);
-    InertiaTensor[7] += (*iter)->type->mass*(-x[2]*x[1]);
-    InertiaTensor[8] += (*iter)->type->mass*(x[0]*x[0] + x[1]*x[1]);
-  }
-  // print InertiaTensor for debugging
-  DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl);
-  for(int i=0;i<NDIM;i++) {
-    for(int j=0;j<NDIM;j++)
-      DoLog(0) && (Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ");
-    DoLog(0) && (Log() << Verbose(0) << endl);
-  }
-  DoLog(0) && (Log() << Verbose(0) << endl);
-
-  // diagonalize to determine principal axis system
-  gsl_eigen_symmv_workspace *T = gsl_eigen_symmv_alloc(NDIM);
-  gsl_matrix_view m = gsl_matrix_view_array(InertiaTensor, NDIM, NDIM);
-  gsl_vector *eval = gsl_vector_alloc(NDIM);
-  gsl_matrix *evec = gsl_matrix_alloc(NDIM, NDIM);
-  gsl_eigen_symmv(&m.matrix, eval, evec, T);
-  gsl_eigen_symmv_free(T);
-  gsl_eigen_symmv_sort(eval, evec, GSL_EIGEN_SORT_ABS_DESC);
-
-  for(int i=0;i<NDIM;i++) {
-    DoLog(1) && (Log() << Verbose(1) << "eigenvalue = " << gsl_vector_get(eval, i));
-    DoLog(0) && (Log() << Verbose(0) << ", eigenvector = (" << evec->data[i * evec->tda + 0] << "," << evec->data[i * evec->tda + 1] << "," << evec->data[i * evec->tda + 2] << ")" << endl);
-  }
-
-  // check whether we rotate or not
-  if (DoRotate) {
-    DoLog(1) && (Log() << Verbose(1) << "Transforming molecule into PAS ... ");
-    // the eigenvectors specify the transformation matrix
-    Matrix M = Matrix(evec->data);
-
-    BOOST_FOREACH(atom* iter, atoms){
-      (*iter->node) *= M;
-    }
-    DoLog(0) && (Log() << Verbose(0) << "done." << endl);
-
-    // summing anew for debugging (resulting matrix has to be diagonal!)
-    // reset inertia tensor
-    for(int i=0;i<NDIM*NDIM;i++)
-      InertiaTensor[i] = 0.;
-
-    // sum up inertia tensor
-    for (molecule::const_iterator iter = begin(); iter != end(); ++iter) {
-      Vector x = (*iter)->x;
-      InertiaTensor[0] += (*iter)->type->mass*(x[1]*x[1] + x[2]*x[2]);
-      InertiaTensor[1] += (*iter)->type->mass*(-x[0]*x[1]);
-      InertiaTensor[2] += (*iter)->type->mass*(-x[0]*x[2]);
-      InertiaTensor[3] += (*iter)->type->mass*(-x[1]*x[0]);
-      InertiaTensor[4] += (*iter)->type->mass*(x[0]*x[0] + x[2]*x[2]);
-      InertiaTensor[5] += (*iter)->type->mass*(-x[1]*x[2]);
-      InertiaTensor[6] += (*iter)->type->mass*(-x[2]*x[0]);
-      InertiaTensor[7] += (*iter)->type->mass*(-x[2]*x[1]);
-      InertiaTensor[8] += (*iter)->type->mass*(x[0]*x[0] + x[1]*x[1]);
-    }
-    // print InertiaTensor for debugging
-    DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl);
-    for(int i=0;i<NDIM;i++) {
-      for(int j=0;j<NDIM;j++)
-        DoLog(0) && (Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ");
-      DoLog(0) && (Log() << Verbose(0) << endl);
-    }
-    DoLog(0) && (Log() << Verbose(0) << endl);
-  }
-
-  // free everything
-  delete(CenterOfGravity);
-  gsl_vector_free(eval);
-  gsl_matrix_free(evec);
-};
-
-
 /** Align all atoms in such a manner that given vector \a *n is along z axis.
  * \param n[] alignment vector.
Index: tests/regression/testsuite-molecules.at
===================================================================
--- tests/regression/testsuite-molecules.at	(revision a439e552b524ad69d77533afc340c392ecf15aab)
+++ tests/regression/testsuite-molecules.at	(revision 6e5084ba8942d5b07318fb32c642c0078c9dafe5)
@@ -64,5 +64,5 @@
 AT_KEYWORDS([Molecules])
 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/pre/test.* .], 0)
-AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m 0], 0, [stdout], [stderr])
+AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr])
 #AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore])
 AT_CLEANUP
