Index: src/unittests/ActOnAllUnitTest.cpp
===================================================================
--- src/unittests/ActOnAllUnitTest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/ActOnAllUnitTest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -56,7 +56,7 @@
 
   // adding, subtracting
-  VL.ActOnAll( &Vector::AddVector, &test );
+  VL.ActOnAll( &Vector::AddVector, test );
   CPPUNIT_ASSERT_EQUAL( VL == Ref , false );
-  VL.ActOnAll( &Vector::SubtractVector, &test );
+  VL.ActOnAll( &Vector::SubtractVector, test );
   CPPUNIT_ASSERT_EQUAL( VL == Ref , true );
 };
@@ -70,15 +70,8 @@
 
   // scaling by value
-  VL.ActOnAll( (void (Vector::*)(const double)) &Vector::Scale, 2. );
+  VL.ActOnAll( (void (Vector::*)(const double)) &Vector::Scale, factor );
   CPPUNIT_ASSERT_EQUAL( VL == Ref , false );
 
-  VL.ActOnAll( (void (Vector::*)(const double)) &Vector::Scale, 0.5 );
-  CPPUNIT_ASSERT_EQUAL( VL == Ref , true );
-
-  // scaling by ref
-  VL.ActOnAll( (void (Vector::*)(const double * const)) &Vector::Scale, (const double * const)&factor );
-  CPPUNIT_ASSERT_EQUAL( VL == Ref , false );
-
-  VL.ActOnAll( (void (Vector::*)(const double * const)) &Vector::Scale, (const double * const)&inverse );
+  VL.ActOnAll( (void (Vector::*)(const double)) &Vector::Scale, inverse );
   CPPUNIT_ASSERT_EQUAL( VL == Ref , true );
 
@@ -90,12 +83,23 @@
     inverses[i] = 1./factors[i];
   }
-  VL.ActOnAll( (void (Vector::*)(const double ** const)) &Vector::Scale, (const double ** const)&factors );
+  VL.ActOnAll<Vector,void,const double*>(&Vector::ScaleAll, factors );
   CPPUNIT_ASSERT_EQUAL( VL == Ref , false );
 
-  VL.ActOnAll( (void (Vector::*)(const double ** const)) &Vector::Scale, (const double ** const)&inverses );
+  VL.ActOnAll<Vector,void,const double*>(&Vector::ScaleAll, inverses );
   CPPUNIT_ASSERT_EQUAL( VL == Ref , true );
   Free(factors);
   Free(inverses);
 };
+
+#if 0
+
+// Unitttest deactivated for now...
+// Reasons:
+//    Vector::MakeNormalVector has been removed and is now part of Plane class
+//    VectorList::ActOnAll is in the test directory and seems to be used only for unittests
+//    MakeNormal never depended on the input Vector except in the case of linear dependence (i.e. failure)
+//
+// TODO: Rethink what exactely is being tested at this point and introduce a new unittest for the
+//       tested behaviour. Most likely this should result in a thourough unittest of the plane class
 
 /** UnitTest for VectorList::ActOnAll() and Vector::MakeNormalVector()
@@ -113,6 +117,8 @@
   // check that x and y components are zero
   for (ListOfVectors::iterator Runner = VL.Vectors.begin(); Runner != VL.Vectors.end(); Runner++) {
-    CPPUNIT_ASSERT_EQUAL( (*Runner)->x[0] , 0. );
-    CPPUNIT_ASSERT_EQUAL( (*Runner)->x[1] , 0. );
+    CPPUNIT_ASSERT_EQUAL( (*Runner)->at(0) , 0. );
+    CPPUNIT_ASSERT_EQUAL( (*Runner)->at(1) , 0. );
   }
 };
+
+#endif
Index: src/unittests/ActOnAllUnitTest.hpp
===================================================================
--- src/unittests/ActOnAllUnitTest.hpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/ActOnAllUnitTest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -20,5 +20,8 @@
     CPPUNIT_TEST ( AddSubtractTest );
     CPPUNIT_TEST ( ScaleTest );
+#if 0
+    // test deactivated. See .cpp for reasons and workarounds
     CPPUNIT_TEST ( NormalizeTest );
+#endif
     CPPUNIT_TEST_SUITE_END();
 
Index: src/unittests/ActionSequenceTest.cpp
===================================================================
--- src/unittests/ActionSequenceTest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/ActionSequenceTest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -13,4 +13,7 @@
 #include "Actions/Action.hpp"
 #include "Actions/ActionSequence.hpp"
+#include "Actions/MakroAction.hpp"
+#include "Actions/ActionHistory.hpp"
+#include "Actions/ActionRegistry.hpp"
 
 #ifdef HAVE_TESTRUNNER
@@ -22,9 +25,4 @@
 // Registers the fixture into the 'registry'
 CPPUNIT_TEST_SUITE_REGISTRATION( ActionSequenceTest );
-
-void setUp();
-void tearDown();
-
-void canUndoTest();
 
 /* some neccessary stubs for tests */
@@ -110,4 +108,5 @@
 
 void ActionSequenceTest::setUp(){
+  ActionHistory::init();
   // create some necessary stubs used in this test
   positive1 = new canUndoActionStub();
@@ -134,4 +133,6 @@
   delete shouldNotCall2;
 
+  ActionHistory::purgeInstance();
+  ActionRegistry::purgeInstance();
 }
 
@@ -209,23 +210,22 @@
 void ActionSequenceTest::doesUndoTest(){
   ActionSequence *sequence = new ActionSequence();
-  sequence->addAction(shouldNotCall1);
-  sequence->addAction(shouldNotCall2);
-  sequence->addAction(shouldCall1);
-  sequence->addAction(shouldCall2);
-
-  ActionSequence::stateSet states = sequence->callAll();
-
-  sequence->removeLastAction();
-  sequence->removeLastAction();
-
-  sequence->undoAll(states);
-
-  CPPUNIT_ASSERT_EQUAL(true,shouldCall1->wasCalled());
-  CPPUNIT_ASSERT_EQUAL(true,shouldCall2->wasCalled());
-  CPPUNIT_ASSERT_EQUAL(false,shouldNotCall1->wasCalled());
-  CPPUNIT_ASSERT_EQUAL(false,shouldNotCall2->wasCalled());
-
-  delete sequence;
-}
-
-
+  wasCalledActionStub *wasCalled1 = new wasCalledActionStub();
+  wasCalledActionStub *wasCalled2 = new wasCalledActionStub();
+  sequence->addAction(wasCalled1);
+  sequence->addAction(wasCalled2);
+
+  MakroAction act("Test MakroAction",sequence,false);
+
+  act.call();
+
+  CPPUNIT_ASSERT_EQUAL(true,wasCalled1->wasCalled());
+  CPPUNIT_ASSERT_EQUAL(true,wasCalled1->wasCalled());
+
+  ActionHistory::getInstance().undoLast();
+
+  CPPUNIT_ASSERT_EQUAL(false,wasCalled1->wasCalled());
+  CPPUNIT_ASSERT_EQUAL(false,wasCalled1->wasCalled());
+
+}
+
+
Index: src/unittests/AnalysisCorrelationToPointUnitTest.cpp
===================================================================
--- src/unittests/AnalysisCorrelationToPointUnitTest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/AnalysisCorrelationToPointUnitTest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -64,17 +64,17 @@
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(1., 0., 1. );
+  *Walker->node = Vector(1., 0., 1. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(0., 1., 1. );
+  *Walker->node = Vector(0., 1., 1. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(1., 1., 0. );
+  *Walker->node = Vector(1., 1., 0. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(0., 0., 0. );
+  *Walker->node = Vector(0., 0., 0. );
   TestMolecule->AddAtom(Walker);
 
@@ -83,6 +83,6 @@
 
   TestList = World::getInstance().getMolecules();
+  TestList->insert(TestMolecule);
   TestMolecule->ActiveFlag = true;
-  TestList->insert(TestMolecule);
 
   // init point
@@ -122,6 +122,6 @@
   // put pair correlation into bins and check with no range
   binmap = BinData( pointmap, 0.5, 0., 0. );
-  CPPUNIT_ASSERT_EQUAL( (size_t)2, binmap->size() );
-  //OutputCorrelation ( binmap );
+  OutputCorrelation ( (ofstream *)&cout, binmap );
+  CPPUNIT_ASSERT_EQUAL( (size_t)3, binmap->size() );
   tester = binmap->begin();
   CPPUNIT_ASSERT_EQUAL( 1., tester->first );
@@ -135,6 +135,6 @@
   // ... and check with [0., 2.] range
   binmap = BinData( pointmap, 0.5, 0., 2. );
+  OutputCorrelation ( (ofstream *)&cout, binmap );
   CPPUNIT_ASSERT_EQUAL( (size_t)5, binmap->size() );
-  //OutputCorrelation ( binmap );
   tester = binmap->begin();
   CPPUNIT_ASSERT_EQUAL( 0., tester->first );
Index: src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
===================================================================
--- src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -40,5 +40,5 @@
 void AnalysisCorrelationToSurfaceUnitTest::setUp()
 {
-  ASSERT_DO(Assert::Throw);
+  //ASSERT_DO(Assert::Throw);
 
   atom *Walker = NULL;
@@ -46,5 +46,5 @@
   // init private all pointers to zero
   TestList = NULL;
-  TestMolecule = NULL;
+  TestSurfaceMolecule = NULL;
   hydrogen = NULL;
   tafel = NULL;
@@ -70,55 +70,56 @@
 
   // construct molecule (tetraeder of hydrogens) base
-  TestMolecule = World::getInstance().createMolecule();
-  Walker = World::getInstance().createAtom();
-  Walker->type = hydrogen;
-  Walker->node->Init(1., 0., 1. );
-  TestMolecule->AddAtom(Walker);
-  Walker = World::getInstance().createAtom();
-  Walker->type = hydrogen;
-  Walker->node->Init(0., 1., 1. );
-  TestMolecule->AddAtom(Walker);
-  Walker = World::getInstance().createAtom();
-  Walker->type = hydrogen;
-  Walker->node->Init(1., 1., 0. );
-  TestMolecule->AddAtom(Walker);
-  Walker = World::getInstance().createAtom();
-  Walker->type = hydrogen;
-  Walker->node->Init(0., 0., 0. );
-  TestMolecule->AddAtom(Walker);
+  TestSurfaceMolecule = World::getInstance().createMolecule();
+  Walker = World::getInstance().createAtom();
+  Walker->type = hydrogen;
+  *Walker->node = Vector(1., 0., 1. );
+
+  TestSurfaceMolecule->AddAtom(Walker);
+  Walker = World::getInstance().createAtom();
+  Walker->type = hydrogen;
+  *Walker->node = Vector(0., 1., 1. );
+  TestSurfaceMolecule->AddAtom(Walker);
+  Walker = World::getInstance().createAtom();
+  Walker->type = hydrogen;
+  *Walker->node = Vector(1., 1., 0. );
+  TestSurfaceMolecule->AddAtom(Walker);
+  Walker = World::getInstance().createAtom();
+  Walker->type = hydrogen;
+  *Walker->node = Vector(0., 0., 0. );
+  TestSurfaceMolecule->AddAtom(Walker);
 
   // check that TestMolecule was correctly constructed
-  CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
+  CPPUNIT_ASSERT_EQUAL( TestSurfaceMolecule->AtomCount, 4 );
 
   TestList = World::getInstance().getMolecules();
-  TestMolecule->ActiveFlag = true;
-  TestList->insert(TestMolecule);
+  TestSurfaceMolecule->ActiveFlag = true;
+  TestList->insert(TestSurfaceMolecule);
 
   // init tesselation and linked cell
   Surface = new Tesselation;
-  FindNonConvexBorder(TestMolecule, Surface, (const LinkedCell *&)LC, 2.5, NULL);
-  LC = new LinkedCell(TestMolecule, 5.);
-  CPPUNIT_ASSERT_EQUAL( (size_t)4, Surface->PointsOnBoundary.size() );
-  CPPUNIT_ASSERT_EQUAL( (size_t)6, Surface->LinesOnBoundary.size() );
-  CPPUNIT_ASSERT_EQUAL( (size_t)4, Surface->TrianglesOnBoundary.size() );
+  LC = new LinkedCell(TestSurfaceMolecule, 5.);
+  FindNonConvexBorder(TestSurfaceMolecule, Surface, (const LinkedCell *&)LC, 2.5, NULL);
 
   // add outer atoms
-  Walker = World::getInstance().createAtom();
-  Walker->type = carbon;
-  Walker->node->Init(4., 0., 4. );
-  TestMolecule->AddAtom(Walker);
-  Walker = World::getInstance().createAtom();
-  Walker->type = carbon;
-  Walker->node->Init(0., 4., 4. );
-  TestMolecule->AddAtom(Walker);
-  Walker = World::getInstance().createAtom();
-  Walker->type = carbon;
-  Walker->node->Init(4., 4., 0. );
-  TestMolecule->AddAtom(Walker);
+  TestSurfaceMolecule = World::getInstance().createMolecule();
+  Walker = World::getInstance().createAtom();
+  Walker->type = carbon;
+  *Walker->node = Vector(4., 0., 4. );
+  TestSurfaceMolecule->AddAtom(Walker);
+  Walker = World::getInstance().createAtom();
+  Walker->type = carbon;
+  *Walker->node = Vector(0., 4., 4. );
+  TestSurfaceMolecule->AddAtom(Walker);
+  Walker = World::getInstance().createAtom();
+  Walker->type = carbon;
+  *Walker->node = Vector(4., 4., 0. );
+  TestSurfaceMolecule->AddAtom(Walker);
   // add inner atoms
   Walker = World::getInstance().createAtom();
   Walker->type = carbon;
-  Walker->node->Init(0.5, 0.5, 0.5 );
-  TestMolecule->AddAtom(Walker);
+  *Walker->node = Vector(0.5, 0.5, 0.5 );
+  TestSurfaceMolecule->AddAtom(Walker);
+  TestSurfaceMolecule->ActiveFlag = true;
+  TestList->insert(TestSurfaceMolecule);
 
   // init maps
@@ -145,8 +146,20 @@
 
 
+/** Checks whether setup() does the right thing.
+ */
+void AnalysisCorrelationToSurfaceUnitTest::SurfaceTest()
+{
+  CPPUNIT_ASSERT_EQUAL( 4, TestSurfaceMolecule->AtomCount );
+  CPPUNIT_ASSERT_EQUAL( (size_t)2, TestList->ListOfMolecules.size() );
+  CPPUNIT_ASSERT_EQUAL( (size_t)4, Surface->PointsOnBoundary.size() );
+  CPPUNIT_ASSERT_EQUAL( (size_t)6, Surface->LinesOnBoundary.size() );
+  CPPUNIT_ASSERT_EQUAL( (size_t)4, Surface->TrianglesOnBoundary.size() );
+};
+
 void AnalysisCorrelationToSurfaceUnitTest::CorrelationToSurfaceTest()
 {
   // do the pair correlation
   surfacemap = CorrelationToSurface( TestList, hydrogen, Surface, LC );
+//  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
   CPPUNIT_ASSERT( surfacemap != NULL );
   CPPUNIT_ASSERT_EQUAL( (size_t)4, surfacemap->size() );
@@ -158,7 +171,8 @@
   surfacemap = CorrelationToSurface( TestList, hydrogen, Surface, LC );
   // put pair correlation into bins and check with no range
+//  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
   binmap = BinData( surfacemap, 0.5, 0., 0. );
   CPPUNIT_ASSERT_EQUAL( (size_t)1, binmap->size() );
-  //OutputCorrelation ( binmap );
+  OutputCorrelation ( (ofstream *)&cout, binmap );
   tester = binmap->begin();
   CPPUNIT_ASSERT_EQUAL( 0., tester->first );
@@ -171,8 +185,9 @@
   BinPairMap::iterator tester;
   surfacemap = CorrelationToSurface( TestList, hydrogen, Surface, LC );
+//  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
   // ... and check with [0., 2.] range
   binmap = BinData( surfacemap, 0.5, 0., 2. );
   CPPUNIT_ASSERT_EQUAL( (size_t)5, binmap->size() );
-  //OutputCorrelation ( binmap );
+//  OutputCorrelation ( (ofstream *)&cout, binmap );
   tester = binmap->begin();
   CPPUNIT_ASSERT_EQUAL( 0., tester->first );
@@ -188,14 +203,15 @@
   BinPairMap::iterator tester;
   surfacemap = CorrelationToSurface( TestList, carbon, Surface, LC );
+//  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
   // put pair correlation into bins and check with no range
   binmap = BinData( surfacemap, 0.5, 0., 0. );
-  CPPUNIT_ASSERT_EQUAL( (size_t)2, binmap->size() );
-  OutputCorrelation ( (ofstream *)&cout, binmap );
+  //OutputCorrelation ( (ofstream *)&cout, binmap );
+  CPPUNIT_ASSERT_EQUAL( (size_t)9, binmap->size() );
   // inside point is first and must have negative value
-  tester = binmap->lower_bound(2.95); // start depends on the min value and
+  tester = binmap->lower_bound(4.25-0.5); // start depends on the min value and
   CPPUNIT_ASSERT( tester != binmap->end() );
   CPPUNIT_ASSERT_EQUAL( 3, tester->second );
   // inner point
-  tester = binmap->lower_bound(-0.5);
+  tester = binmap->lower_bound(0.);
   CPPUNIT_ASSERT( tester != binmap->end() );
   CPPUNIT_ASSERT_EQUAL( 1, tester->second );
@@ -206,16 +222,16 @@
   BinPairMap::iterator tester;
   surfacemap = CorrelationToSurface( TestList, carbon, Surface, LC );
+//  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
   // ... and check with [0., 2.] range
   binmap = BinData( surfacemap, 0.5, -2., 4. );
+  //OutputCorrelation ( (ofstream *)&cout, binmap );
   CPPUNIT_ASSERT_EQUAL( (size_t)13, binmap->size() );
-  OutputCorrelation ( (ofstream *)&cout, binmap );
   // three outside points
-  tester = binmap->lower_bound(3.);
+  tester = binmap->lower_bound(4.25-0.5);
   CPPUNIT_ASSERT( tester != binmap->end() );
   CPPUNIT_ASSERT_EQUAL( 3, tester->second );
   // inner point
-  tester = binmap->lower_bound(-0.5);
+  tester = binmap->lower_bound(0.);
   CPPUNIT_ASSERT( tester != binmap->end() );
   CPPUNIT_ASSERT_EQUAL( 1, tester->second );
-
-};
+};
Index: src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp
===================================================================
--- src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -23,4 +23,5 @@
 {
     CPPUNIT_TEST_SUITE( AnalysisCorrelationToSurfaceUnitTest ) ;
+    CPPUNIT_TEST ( SurfaceTest );
     CPPUNIT_TEST ( CorrelationToSurfaceTest );
     CPPUNIT_TEST ( CorrelationToSurfaceHydrogenBinNoRangeTest );
@@ -33,4 +34,5 @@
       void setUp();
       void tearDown();
+      void SurfaceTest();
       void CorrelationToSurfaceTest();
       void CorrelationToSurfaceHydrogenBinNoRangeTest();
@@ -42,5 +44,5 @@
 
       MoleculeListClass *TestList;
-      molecule *TestMolecule;
+      molecule *TestSurfaceMolecule;
       element *hydrogen;
       element *carbon;
Index: src/unittests/AnalysisPairCorrelationUnitTest.cpp
===================================================================
--- src/unittests/AnalysisPairCorrelationUnitTest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/AnalysisPairCorrelationUnitTest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -63,17 +63,17 @@
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(1., 0., 1. );
+  *Walker->node = Vector(1., 0., 1. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(0., 1., 1. );
+  *Walker->node = Vector(0., 1., 1. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(1., 1., 0. );
+  *Walker->node = Vector(1., 1., 0. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(0., 0., 0. );
+  *Walker->node = Vector(0., 0., 0. );
   TestMolecule->AddAtom(Walker);
 
Index: src/unittests/CountBondsUnitTest.cpp
===================================================================
--- src/unittests/CountBondsUnitTest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
+++ src/unittests/CountBondsUnitTest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -0,0 +1,240 @@
+/*
+ * CountBondsUnitTest.cpp
+ *
+ *  Created on: Mar 30, 2010
+ *      Author: heber
+ */
+
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include <iostream>
+#include <stdio.h>
+#include <cstring>
+
+#include "analysis_bonds.hpp"
+#include "atom.hpp"
+#include "bond.hpp"
+#include "bondgraph.hpp"
+#include "element.hpp"
+#include "molecule.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+#include "CountBondsUnitTest.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( CountBondsTest );
+
+
+void CountBondsTest::setUp()
+{
+  atom *Walker = NULL;
+  BG = NULL;
+  filename = NULL;
+
+  // init private all pointers to zero
+  molecules = NULL;
+  TestMolecule1 = NULL;
+  TestMolecule2 = NULL;
+  hydrogen = NULL;
+  oxygen = NULL;
+  tafel = NULL;
+
+  // construct element
+  hydrogen = new element;
+  hydrogen->Z = 1;
+  hydrogen->CovalentRadius = 0.23;
+  strcpy(hydrogen->name, "hydrogen");
+  strcpy(hydrogen->symbol, "H");
+  oxygen = new element;
+  oxygen->Z = 8;
+  oxygen->CovalentRadius = 0.68;
+  strcpy(oxygen->name, "oxygen");
+  strcpy(oxygen->symbol, "O");
+
+  // construct periodentafel
+  tafel = World::getInstance().getPeriode();
+  tafel->AddElement(hydrogen);
+  tafel->AddElement(oxygen);
+
+  // construct molecule (water molecule)
+  TestMolecule1 = World::getInstance().createMolecule();
+  Walker = World::getInstance().createAtom();
+  Walker->type = hydrogen;
+  *Walker->node = Vector(-0.2418, 0.9350, 0. );
+  TestMolecule1->AddAtom(Walker);
+  Walker = World::getInstance().createAtom();
+  Walker->type = hydrogen;
+  *Walker->node = Vector(0.9658, 0., 0. );
+  TestMolecule1->AddAtom(Walker);
+  Walker = World::getInstance().createAtom();
+  Walker->type = oxygen;
+  *Walker->node = Vector(0., 0., 0. );
+  TestMolecule1->AddAtom(Walker);
+
+  TestMolecule2 = World::getInstance().createMolecule();
+  Walker = World::getInstance().createAtom();
+  Walker->type = hydrogen;
+  *Walker->node = Vector(-0.2418, 0.9350, 0. );
+  TestMolecule2->AddAtom(Walker);
+  Walker = World::getInstance().createAtom();
+  Walker->type = hydrogen;
+  *Walker->node = Vector(0.9658, 0., 0. );
+  TestMolecule2->AddAtom(Walker);
+  Walker = World::getInstance().createAtom();
+  Walker->type = oxygen;
+  *Walker->node = Vector(0., 0., 0. );
+  TestMolecule2->AddAtom(Walker);
+
+  molecules = World::getInstance().getMolecules();
+  molecules->insert(TestMolecule1);
+  molecules->insert(TestMolecule2);
+
+  // check that TestMolecule was correctly constructed
+  CPPUNIT_ASSERT_EQUAL( TestMolecule1->AtomCount, 3 );
+  Walker = TestMolecule1->start->next;
+  CPPUNIT_ASSERT( TestMolecule1->end != Walker );
+  CPPUNIT_ASSERT_EQUAL( TestMolecule2->AtomCount, 3 );
+  Walker = TestMolecule2->start->next;
+  CPPUNIT_ASSERT( TestMolecule2->end != Walker );
+
+  // create a small file with table
+  BG = new BondGraph(true);
+
+  // construct bond graphs
+  CPPUNIT_ASSERT_EQUAL( true , BG->ConstructBondGraph(TestMolecule1) );
+  CPPUNIT_ASSERT_EQUAL( true , BG->ConstructBondGraph(TestMolecule2) );
+//  TestMolecule1->Output((ofstream *)&cout);
+//  TestMolecule1->OutputBondsList();
+};
+
+
+void CountBondsTest::tearDown()
+{
+  // remove the file
+  delete(BG);
+
+  World::purgeInstance();
+  MemoryUsageObserver::purgeInstance();
+};
+
+/** UnitTest for CountBondsTest::BondsOfTwoTest().
+ */
+void CountBondsTest::BondsOfTwoTest()
+{
+  CPPUNIT_ASSERT_EQUAL( 4 , CountBondsOfTwo(molecules, hydrogen, oxygen) );
+  CPPUNIT_ASSERT_EQUAL( 0 , CountBondsOfTwo(molecules, hydrogen, hydrogen) );
+  CPPUNIT_ASSERT_EQUAL( 0 , CountBondsOfTwo(molecules, oxygen, oxygen) );
+};
+
+/** UnitTest for CountBondsTest::BondsOfThreeTest().
+ */
+void CountBondsTest::BondsOfThreeTest()
+{
+  CPPUNIT_ASSERT_EQUAL( 2 , CountBondsOfThree(molecules, hydrogen, oxygen, hydrogen) );
+  CPPUNIT_ASSERT_EQUAL( 0 , CountBondsOfThree(molecules, oxygen, hydrogen, oxygen) );
+};
+
+void OutputTestMolecule(molecule *mol, const char *name)
+{
+  ofstream output(name);
+  mol->OutputXYZ(&output);
+  output.close();
+}
+
+/** UnitTest for CountBondsTest::HydrogenBridgeBondsTest().
+ */
+void CountBondsTest::HydrogenBridgeBondsTest()
+{
+  double *mirror = new double[3];
+  for (int i=0;i<3;i++)
+    mirror[i] = -1.;
+  Vector Translator;
+
+  //OutputTestMolecule(TestMolecule1, "testmolecule1.xyz");
+
+  cout << "Case 1: offset of (3,0,0), hence angles are (104.5, 0, 75.5, 180) < 30." << endl;
+  Translator  = Vector(3,0,0);
+  TestMolecule2->Translate(&Translator);
+  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) );
+  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, oxygen) );
+  //OutputTestMolecule(TestMolecule2, "testmolecule2-1.xyz");
+  Translator = Vector(-3,0,0);
+  TestMolecule2->Translate(&Translator);
+
+  cout << "Case 2: offset of (0,3,0), hence angle are (14.5, 165.5, 90) < 30 (only three, because other 90 is missing due to first H01 only fulfilling H-bond criteria)." << endl;
+  Translator = Vector(0,3,0);
+  TestMolecule2->Translate(&Translator);
+  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) );
+  //OutputTestMolecule(TestMolecule2, "testmolecule2-2.xyz");
+  Translator = Vector(0,-3,0);
+  TestMolecule2->Translate(&Translator);
+
+  cout << "Case 3: offset of (0,-3,0) and mirror, hence angle are (165.5, 90, 165.5, 90) > 30." << endl;
+  Translator = Vector(0,-3,0);
+  TestMolecule2->Scale((const double ** const)&mirror);
+  TestMolecule2->Translate(&Translator);
+  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
+  //OutputTestMolecule(TestMolecule2, "testmolecule2-3.xyz");
+  Translator = Vector(0,3,0);
+  TestMolecule2->Translate(&Translator);
+  TestMolecule2->Scale((const double ** const)&mirror);
+
+  cout << "Case 4: offset of (2,1,0), hence angle are (78, 26.6, 102, 153.4) < 30." << endl;
+  Translator = Vector(2,1,0);
+  TestMolecule2->Translate(&Translator);
+  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) );
+  //OutputTestMolecule(TestMolecule2, "testmolecule2-4.xyz");
+  Translator = Vector(-2,-1,0);
+  TestMolecule2->Translate(&Translator);
+
+  cout << "Case 5: offset of (0,0,3), hence angle are (90, 90, 90, 90) > 30." << endl;
+  Translator = Vector(0,0,3);
+  TestMolecule2->Translate(&Translator);
+  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
+  //OutputTestMolecule(TestMolecule2, "testmolecule2-5.xyz");
+  Translator = Vector(0,0,-3);
+  TestMolecule2->Translate(&Translator);
+
+  cout << "Case 6: offset of (-3,0,0) and mirror, hence angle are (75.5, 180, 104.5, 180) > 30." << endl;
+  Translator = Vector(-3,0,0);
+  TestMolecule2->Scale((const double ** const)&mirror);
+  TestMolecule2->Translate(&Translator);
+  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
+  //OutputTestMolecule(TestMolecule2, "testmolecule2-6.xyz");
+  Translator = Vector(3,0,0);
+  TestMolecule2->Translate(&Translator);
+  TestMolecule2->Scale((const double ** const)&mirror);
+
+  cout << "Case 7: offset of (3,0,0) and mirror, hence angles are (104.5, 0, 104.5, 0) < 30, but interfering hydrogens." << endl;
+  Translator = Vector(3,0,0);
+  TestMolecule2->Scale((const double ** const)&mirror);
+  TestMolecule2->Translate(&Translator);
+  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
+  //OutputTestMolecule(TestMolecule2, "testmolecule2-7.xyz");
+  Translator = Vector(-3,0,0);
+  TestMolecule2->Translate(&Translator);
+  TestMolecule2->Scale((const double ** const)&mirror);
+
+  cout << "Case 8: offset of (0,3,0), hence angle are (14.5, 90, 14.5, 90) < 30, but interfering hydrogens." << endl;
+  Translator = Vector(0,3,0);
+  TestMolecule2->Scale((const double ** const)&mirror);
+  TestMolecule2->Translate(&Translator);
+  //OutputTestMolecule(TestMolecule2, "testmolecule2-8.xyz");
+  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
+  Translator = Vector(0,-3,0);
+  TestMolecule2->Translate(&Translator);
+  TestMolecule2->Scale((const double ** const)&mirror);
+
+  delete[](mirror);
+};
Index: src/unittests/CountBondsUnitTest.hpp
===================================================================
--- src/unittests/CountBondsUnitTest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
+++ src/unittests/CountBondsUnitTest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -0,0 +1,50 @@
+/*
+ * CountBondsUnitTest.hpp
+ *
+ *  Created on: Mar 30, 2010
+ *      Author: heber
+ */
+
+#ifndef COUNTBONDSUNITTEST_HPP_
+#define COUNTBONDSUNITTEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+
+class BondGraph;
+class element;
+class molecule;
+class periodentafel;
+
+/********************************************** Test classes **************************************/
+
+class CountBondsTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( CountBondsTest) ;
+    CPPUNIT_TEST ( BondsOfTwoTest );
+    CPPUNIT_TEST ( BondsOfThreeTest );
+    CPPUNIT_TEST ( HydrogenBridgeBondsTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void BondsOfTwoTest();
+      void BondsOfThreeTest();
+      void HydrogenBridgeBondsTest();
+
+private:
+
+      MoleculeListClass *molecules;
+      molecule *TestMolecule1;
+      molecule *TestMolecule2;
+      element *hydrogen;
+      element *oxygen;
+      periodentafel *tafel;
+
+      BondGraph *BG;
+      string *filename;
+};
+
+
+#endif /* COUNTBONDSUNITTEST_HPP_ */
Index: src/unittests/LinkedCellUnitTest.cpp
===================================================================
--- src/unittests/LinkedCellUnitTest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
+++ src/unittests/LinkedCellUnitTest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -0,0 +1,372 @@
+/*
+ * LinkedCellUnitTest.cpp
+ *
+ *  Created on: Apr 9, 2010
+ *      Author: heber
+ */
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include <iostream>
+#include <stdio.h>
+#include <cstring>
+
+#include "atom.hpp"
+#include "element.hpp"
+#include "linkedcell.hpp"
+#include "molecule.hpp"
+#include "periodentafel.hpp"
+#include "LinkedCellUnitTest.hpp"
+#include "World.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( LinkedCellTest );
+
+
+void LinkedCellTest::setUp()
+{
+  atom *Walker = NULL;
+
+  // init private all pointers to zero
+  TestMolecule = NULL;
+  hydrogen = NULL;
+  tafel = NULL;
+
+  // construct element
+  hydrogen = new element;
+  hydrogen->Z = 1;
+  hydrogen->CovalentRadius = 0.23;
+  strcpy(hydrogen->name, "hydrogen");
+  strcpy(hydrogen->symbol, "H");
+
+  // construct periodentafel
+  tafel = World::getInstance().getPeriode();
+  tafel->AddElement(hydrogen);
+
+  // construct molecule (water molecule)
+  TestMolecule = World::getInstance().createMolecule();
+  for (double x=0.5;x<3;x+=1.)
+    for (double y=0.5;y<3;y+=1.)
+      for (double z=0.5;z<3;z+=1.) {
+        Walker = World::getInstance().createAtom();
+        Walker->type = hydrogen;
+        *Walker->node = Vector(x, y, z );
+        TestMolecule->AddAtom(Walker);
+      }
+
+  // construct linked cell
+  LC = new LinkedCell (TestMolecule, 1.);
+
+  // check that TestMolecule was correctly constructed
+  CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 3*3*3 );
+  Walker = TestMolecule->start->next;
+  CPPUNIT_ASSERT( TestMolecule->end != Walker );
+};
+
+
+void LinkedCellTest::tearDown()
+{
+  delete(LC);
+  World::purgeInstance();
+  MemoryUsageObserver::purgeInstance();
+};
+
+
+/** UnitTest for LinkedCell::CheckBounds().
+ */
+void LinkedCellTest::CheckBoundsTest()
+{
+  // check for within bounds
+  LC->n[0] = LC->n[1] = LC->n[2] = 0;
+  CPPUNIT_ASSERT_EQUAL( true, LC->CheckBounds() );
+  LC->n[0] = LC->n[1] = LC->n[2] = 1;
+  CPPUNIT_ASSERT_EQUAL( true, LC->CheckBounds() );
+  LC->n[0] = LC->n[1] = LC->n[2] = 2;
+  CPPUNIT_ASSERT_EQUAL( true, LC->CheckBounds() );
+
+  // check for out of bounds
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  LC->n[0] = 404040;
+  CPPUNIT_ASSERT_EQUAL( false, LC->CheckBounds() );
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  LC->n[0] = 0;
+  LC->n[1] = 5000;
+  CPPUNIT_ASSERT_EQUAL( false, LC->CheckBounds() );
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  LC->n[1] = 0;
+  LC->n[2] = -70;
+  CPPUNIT_ASSERT_EQUAL( false, LC->CheckBounds() );
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  LC->n[0] = LC->n[1] = LC->n[2] = 3;
+  CPPUNIT_ASSERT_EQUAL( false, LC->CheckBounds() );
+};
+
+
+/** UnitTest for LinkedCell::GetCurrentCell().
+ * Note that CheckBounds() is used and has to be tested already.
+ */
+void LinkedCellTest::GetCurrentCellTest()
+{
+  // within bounds
+  LC->n[0] = LC->n[1] = LC->n[2] = 0;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[0 * 3*3 + 0 * 3 + 0], LC->GetCurrentCell() );
+  LC->n[0] = LC->n[1] = LC->n[2] = 1;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[1 * 3*3 + 1 * 3 + 1], LC->GetCurrentCell() );
+  LC->n[0] = LC->n[1] = LC->n[2] = 2;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[2 * 3*3 + 2 * 3 + 2], LC->GetCurrentCell() );
+
+  // out of bounds
+  LC->n[0] = LC->n[1] = LC->n[2] = 3;
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetCurrentCell() );
+  LC->n[0] = LC->n[1] = LC->n[2] = -1;
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetCurrentCell() );
+};
+
+/** UnitTest for LinkedCell::GetRelativeToCurrentCell().
+ */
+void LinkedCellTest::GetRelativeToCurrentCellTest()
+{
+  int offset[3];
+
+  // offset to (0,0,0) always
+  offset[0] = offset[1] = offset[2] = 0;
+  LC->n[0] = LC->n[1] = LC->n[2] = 0;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) );
+  offset[0] = offset[1] = offset[2] = -1;
+  LC->n[0] = LC->n[1] = LC->n[2] = 1;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) );
+  offset[0] = offset[1] = offset[2] = -2;
+  LC->n[0] = LC->n[1] = LC->n[2] = 2;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) );
+
+  // offset to (0,0,0) - 1.*(x/y/z) out of bounds
+  offset[0] = offset[1] = offset[2] = 0;
+  offset[0] = -1;
+  LC->n[0] = LC->n[1] = LC->n[2] = 0;
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );
+  offset[0] = offset[1] = offset[2] = 0;
+  offset[1] = -1;
+  LC->n[0] = LC->n[1] = LC->n[2] = 0;
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );
+  offset[0] = offset[1] = offset[2] = 0;
+  offset[2] = -1;
+  LC->n[0] = LC->n[1] = LC->n[2] = 0;
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );
+
+  // out of bounds
+  offset[0] = offset[1] = offset[2] = -5054932;
+  LC->n[0] = LC->n[1] = LC->n[2] = 1;
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );
+  offset[0] = offset[1] = offset[2] = 192345;
+  LC->n[0] = LC->n[1] = LC->n[2] = 1;
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );
+
+  // index is out of bounds, offset points within
+  offset[0] = offset[1] = offset[2] = -2;
+  LC->n[0] = LC->n[1] = LC->n[2] = 4;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[2 * 3*3 + 2 * 3 + 2], LC->GetRelativeToCurrentCell(offset) );
+
+  // index is within bounds, offset points out
+  offset[0] = offset[1] = offset[2] = 2;
+  LC->n[0] = LC->n[1] = LC->n[2] = 2;
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );
+};
+
+
+/** UnitTest for LinkedCell::SetIndexToNode().
+ */
+void LinkedCellTest::SetIndexToNodeTest()
+{
+  // check all atoms
+  atom *Walker = TestMolecule->start;
+  while (Walker->next != TestMolecule->end) {
+    Walker = Walker->next;
+    CPPUNIT_ASSERT_EQUAL( true, LC->SetIndexToNode(Walker) );
+  }
+
+  // check internal vectors, returns false, because this atom is not in LC-list!
+  Walker = World::getInstance().createAtom();
+  Walker->Name = Malloc<char>(6, "LinkedCellTest::SetIndexToNodeTest - Walker");
+  strcpy(Walker->Name, "test");
+  Walker->x= Vector(1,1,1);
+  CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(Walker) );
+  World::getInstance().destroyAtom(Walker);
+
+  // check out of bounds vectors
+  Walker = World::getInstance().createAtom();
+  Walker->Name = Malloc<char>(6, "LinkedCellTest::SetIndexToNodeTest - Walker");
+  strcpy(Walker->Name, "test");
+  Walker->x = Vector(0,-1,0);
+  CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(Walker) );
+  World::getInstance().destroyAtom(Walker);
+};
+
+
+/** UnitTest for LinkedCell::SetIndexToVector().
+ */
+void LinkedCellTest::SetIndexToVectorTest()
+{
+  Vector tester;
+
+  // check center of each cell
+  for (double x=0.5;x<3;x+=1.)
+    for (double y=0.5;y<3;y+=1.)
+      for (double z=0.5;z<3;z+=1.) {
+        tester = Vector(x,y,z);
+        CPPUNIT_ASSERT_EQUAL( true, LC->SetIndexToVector(&tester) );
+      }
+  // check corners of each cell
+  for (double x=1.;x<4;x+=1.)
+    for (double y=1.;y<4;y+=1.)
+      for (double z=1.;z<4;z+=1.) {
+        tester= Vector(x,y,z);
+        cout << "Tester is at " << tester << "." << endl;
+        CPPUNIT_ASSERT_EQUAL( true, LC->SetIndexToVector(&tester) );
+      }
+  // check out of bounds
+  for (double x=0.5-1e-10;x<5;x+=3.1)
+    for (double y=0.5-1e-10;y<5;y+=3.1)
+      for (double z=0.5-1e-10;z<5;z+=3.1) {
+        tester = Vector(x,y,z);
+        cout << "The following test is supposed to fail and produce an ERROR." << endl;
+        CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToVector(&tester) );
+      }
+  // check nonsense vectors
+  tester= Vector(-423598,3245978,29349);
+  cout << "The following test is supposed to fail and produce an ERROR." << endl;
+  CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToVector(&tester) );
+};
+
+
+/** UnitTest for LinkedCell::GetNeighbourBounds().
+ */
+void LinkedCellTest::GetNeighbourBoundsTest()
+{
+  Vector tester;
+  int lower[NDIM], upper[NDIM];
+
+  tester= Vector(0.5,0.5,0.5);
+  LC->SetIndexToVector(&tester);
+  LC->GetNeighbourBounds(lower, upper);
+  for (int i=0;i<NDIM;i++)
+    CPPUNIT_ASSERT_EQUAL( 0, lower[i]);
+  for (int i=0;i<NDIM;i++)
+    CPPUNIT_ASSERT_EQUAL( 1, upper[i]);
+};
+
+
+/** UnitTest for LinkedCell::GetallNeighbours().
+ */
+void LinkedCellTest::GetallNeighboursTest()
+{
+  Vector tester;
+  LinkedCell::LinkedNodes *ListOfPoints = NULL;
+  atom *Walker = NULL;
+  size_t size = 0;
+
+  // get all atoms
+  tester= Vector(1.5,1.5,1.5);
+  CPPUNIT_ASSERT_EQUAL ( true, LC->SetIndexToVector(&tester) );
+  ListOfPoints = LC->GetallNeighbours();
+  size = ListOfPoints->size();
+  CPPUNIT_ASSERT_EQUAL( (size_t)27, size );
+  Walker = TestMolecule->start;
+  Walker = TestMolecule->start;
+  while (Walker->next != TestMolecule->end) {
+    Walker = Walker->next;
+    ListOfPoints->remove(Walker);
+    size--;
+    CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() );
+  }
+  CPPUNIT_ASSERT_EQUAL( (size_t)0, size );
+  CPPUNIT_ASSERT_EQUAL( (size_t)0, ListOfPoints->size() );
+  CPPUNIT_ASSERT_EQUAL( true, ListOfPoints->empty() );
+  delete(ListOfPoints);
+
+  // get all atoms in one corner
+  tester= Vector(0.5, 0.5, 0.5);
+  CPPUNIT_ASSERT_EQUAL ( true, LC->SetIndexToVector(&tester) );
+  ListOfPoints = LC->GetallNeighbours();
+  size=ListOfPoints->size();
+  CPPUNIT_ASSERT_EQUAL( (size_t)8, size );
+  Walker = TestMolecule->start;
+  while (Walker->next != TestMolecule->end) {
+    Walker = Walker->next;
+    if ((Walker->x[0] <2) && (Walker->x[1] <2) && (Walker->x[2] <2)) {
+      ListOfPoints->remove(Walker);
+      size--;
+      CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() );
+    }
+  }
+  CPPUNIT_ASSERT_EQUAL( (size_t)0, size );
+  CPPUNIT_ASSERT_EQUAL( (size_t)0, ListOfPoints->size() );
+  CPPUNIT_ASSERT_EQUAL( true, ListOfPoints->empty() );
+  delete(ListOfPoints);
+
+  // get all atoms from one corner
+  tester = Vector(0.5, 0.5, 0.5);
+  CPPUNIT_ASSERT_EQUAL ( true, LC->SetIndexToVector(&tester) );
+  ListOfPoints = LC->GetallNeighbours(3);
+  size=ListOfPoints->size();
+  CPPUNIT_ASSERT_EQUAL( (size_t)27, size );
+  Walker = TestMolecule->start;
+  while (Walker->next != TestMolecule->end) {
+    Walker = Walker->next;
+    ListOfPoints->remove(Walker);
+    size--;
+    CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() );
+  }
+  CPPUNIT_ASSERT_EQUAL( (size_t)0, size );
+  CPPUNIT_ASSERT_EQUAL( (size_t)0, ListOfPoints->size() );
+  CPPUNIT_ASSERT_EQUAL( true, ListOfPoints->empty() );
+  delete(ListOfPoints);
+};
+
+
+/** UnitTest for LinkedCell::GetPointsInsideSphere().
+ */
+void LinkedCellTest::GetPointsInsideSphereTest()
+{
+  Vector tester;
+  LinkedCell::LinkedNodes *ListOfPoints = NULL;
+  atom *Walker = NULL;
+  size_t size = 0;
+
+  // get all points around central arom with radius 1.
+  tester= Vector(1.5,1.5,1.5);
+  CPPUNIT_ASSERT_EQUAL ( true, LC->SetIndexToVector(&tester) );
+  ListOfPoints = LC->GetPointsInsideSphere(1., &tester);
+  size = ListOfPoints->size();
+  CPPUNIT_ASSERT_EQUAL( (size_t)7, size );
+  Walker = TestMolecule->start;
+  while (Walker->next != TestMolecule->end) {
+    Walker = Walker->next;
+    if ((Walker->x.DistanceSquared(tester) - 1.) < MYEPSILON ) {
+      ListOfPoints->remove(Walker);
+      size--;
+      CPPUNIT_ASSERT_EQUAL( size, ListOfPoints->size() );
+    }
+  }
+  CPPUNIT_ASSERT_EQUAL( (size_t)0, size );
+  CPPUNIT_ASSERT_EQUAL( (size_t)0, ListOfPoints->size() );
+  CPPUNIT_ASSERT_EQUAL( true, ListOfPoints->empty() );
+  delete(ListOfPoints);
+};
Index: src/unittests/LinkedCellUnitTest.hpp
===================================================================
--- src/unittests/LinkedCellUnitTest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
+++ src/unittests/LinkedCellUnitTest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -0,0 +1,56 @@
+/*
+ * LinkedCellUnitTest.hpp
+ *
+ *  Created on: Apr 9, 2010
+ *      Author: heber
+ */
+
+#ifndef LINKEDCELLUNITTEST_HPP_
+#define LINKEDCELLUNITTEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+
+class element;
+class LinkedCell;
+class molecule;
+class periodentafel;
+
+/********************************************** Test classes **************************************/
+
+class LinkedCellTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( LinkedCellTest) ;
+    CPPUNIT_TEST ( CheckBoundsTest );
+    CPPUNIT_TEST ( GetCurrentCellTest );
+    CPPUNIT_TEST ( GetRelativeToCurrentCellTest );
+    CPPUNIT_TEST ( SetIndexToNodeTest );
+    CPPUNIT_TEST ( SetIndexToVectorTest );
+    CPPUNIT_TEST ( GetNeighbourBoundsTest );
+    CPPUNIT_TEST ( GetallNeighboursTest );
+    CPPUNIT_TEST ( GetPointsInsideSphereTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+
+      void GetCurrentCellTest();
+      void GetRelativeToCurrentCellTest();
+      void SetIndexToNodeTest();
+      void SetIndexToVectorTest();
+      void CheckBoundsTest();
+      void GetNeighbourBoundsTest();
+      void GetallNeighboursTest();
+      void GetPointsInsideSphereTest();
+
+private:
+
+      molecule *TestMolecule;
+      element *hydrogen;
+      periodentafel *tafel;
+      LinkedCell *LC;
+};
+
+
+#endif /* LINKEDCELLUNITTEST_HPP_ */
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/Makefile.am	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -4,5 +4,6 @@
 AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
 
-MENUTESTS = ActionSequenceTest
+MENUTESTS = \
+  ActionSequenceTest
 
 TESTS = \
@@ -16,4 +17,5 @@
   BondGraphUnitTest \
   CacheableTest \
+  CountBondsUnitTest \
   GSLMatrixSymmetricUnitTest \
   GSLMatrixUnitTest \
@@ -21,4 +23,5 @@
   InfoUnitTest \
   LinearSystemOfEquationsUnitTest \
+  LinkedCellUnitTest \
   ListOfBondsUnitTest \
   LogUnitTest \
@@ -27,4 +30,5 @@
   MemoryAllocatorUnitTest \
   MoleculeDescriptorTest \
+  PlaneUnittest \
   ObserverTest \
   ParserUnitTest \
@@ -37,5 +41,4 @@
   ${MENUTESTS}
   
-
   
 check_PROGRAMS = $(TESTS) 
@@ -56,4 +59,5 @@
   bondgraphunittest.cpp \
   CacheableTest.cpp \
+  CountBondsUnitTest.cpp \
   gslmatrixsymmetricunittest.cpp \
   gslmatrixunittest.cpp \
@@ -61,4 +65,5 @@
   infounittest.cpp \
   linearsystemofequationsunittest.cpp \
+  LinkedCellUnitTest.cpp \
   listofbondsunittest.cpp \
   logunittest.cpp \
@@ -67,4 +72,5 @@
   memoryusageobserverunittest.cpp \
   MoleculeDescriptorTest.cpp \
+  PlaneUnittest.cpp \
   ObserverTest.cpp \
   ParserUnitTest.cpp \
@@ -77,5 +83,36 @@
 
 TESTHEADERS = \
-  analysis_correlation.hpp
+  ActOnAllUnitTest.hpp \
+  ActionSequenceTest.hpp \
+  analysisbondsunittest.hpp \
+  AnalysisCorrelationToPointUnitTest.hpp \
+  AnalysisCorrelationToSurfaceUnitTest.hpp  \
+  AnalysisPairCorrelationUnitTest.hpp \
+  AtomDescriptorTest.hpp \
+  atomsCalculationTest.hpp \
+  bondgraphunittest.hpp \
+  CacheableTest.hpp \
+  CountBondsUnitTest.hpp \
+  gslmatrixsymmetricunittest.hpp \
+  gslmatrixunittest.hpp \
+  gslvectorunittest.hpp \
+  infounittest.hpp \
+  linearsystemofequationsunittest.hpp \
+  LinkedCellUnitTest.hpp \
+  listofbondsunittest.hpp \
+  logunittest.hpp \
+  manipulateAtomsTest.hpp \
+  memoryallocatorunittest.hpp  \
+  memoryusageobserverunittest.hpp \
+  MoleculeDescriptorTest.hpp \
+  PlaneUnittest.hpp \
+  ObserverTest.hpp \
+  SingletonTest.hpp \
+  stackclassunittest.hpp \
+  tesselationunittest.hpp \
+  tesselation_boundarytriangleunittest.hpp \
+  tesselation_insideoutsideunittest.hpp \
+  vectorunittest.hpp
+  
 
 ActOnAllUnitTest_SOURCES = UnitTestMain.cpp ../test/ActOnAllTest.hpp ActOnAllUnitTest.cpp ActOnAllUnitTest.hpp
@@ -100,4 +137,7 @@
 BondGraphUnitTest_LDADD = ${ALLLIBS}
 
+CountBondsUnitTest_SOURCES = UnitTestMain.cpp CountBondsUnitTest.cpp CountBondsUnitTest.hpp
+CountBondsUnitTest_LDADD = ${ALLLIBS}
+
 GSLMatrixSymmetricUnitTest_SOURCES = UnitTestMain.cpp gslmatrixsymmetricunittest.cpp gslmatrixsymmetricunittest.hpp
 GSLMatrixSymmetricUnitTest_LDADD = ${GSLLIBS}
@@ -115,4 +155,7 @@
 LinearSystemOfEquationsUnitTest_LDADD = ${ALLLIBS}
 
+LinkedCellUnitTest_SOURCES = UnitTestMain.cpp LinkedCellUnitTest.cpp LinkedCellUnitTest.hpp 
+LinkedCellUnitTest_LDADD = ${ALLLIBS}
+
 ListOfBondsUnitTest_SOURCES = UnitTestMain.cpp listofbondsunittest.cpp listofbondsunittest.hpp
 ListOfBondsUnitTest_LDADD = ${ALLLIBS}
@@ -130,4 +173,7 @@
 MoleculeDescriptorTest_LDADD = ${ALLLIBS}
 
+PlaneUnittest_SOURCES = UnitTestMain.cpp PlaneUnittest.cpp PlaneUnittest.hpp
+PlaneUnittest_LDADD = ${ALLLIBS}
+
 SingletonTest_SOURCES = UnitTestMain.cpp SingletonTest.cpp SingletonTest.hpp
 SingletonTest_LDADD = $(BOOST_LIB) ${BOOST_THREAD_LIB}
Index: src/unittests/ObserverTest.cpp
===================================================================
--- src/unittests/ObserverTest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/ObserverTest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -116,4 +116,49 @@
   }
   SimpleObservable *subObservable;
+};
+
+class NotificationObservable : public Observable {
+public:
+  NotificationObservable() :
+      notification1(new Notification(this)),
+      notification2(new Notification(this))
+  {}
+
+  ~NotificationObservable(){
+    delete notification1;
+    delete notification2;
+  }
+
+  void operation1(){
+    OBSERVE;
+    NOTIFY(notification1);
+  }
+
+  void operation2(){
+    OBSERVE;
+    NOTIFY(notification2);
+  }
+
+  Notification_ptr notification1;
+  Notification_ptr notification2;
+};
+
+class NotificationObserver : public Observer {
+public:
+  NotificationObserver(Notification_ptr notification) :
+    requestedNotification(notification),
+    wasNotified(false)
+  {}
+
+  void update(Observable*){}
+  void subjectKilled(Observable*){}
+  void recieveNotification(Observable *publisher, Notification_ptr notification){
+    ASSERT(requestedNotification==notification,"Notification received that was not requested");
+    wasNotified = true;
+  }
+
+  Notification_ptr requestedNotification;
+
+  bool wasNotified;
 };
 
@@ -127,4 +172,5 @@
   superObservable = new SuperObservable();
   blockObservable = new BlockObservable();
+  notificationObservable = new NotificationObservable();
 
   observer1 = new UpdateCountObserver();
@@ -132,4 +178,8 @@
   observer3 = new UpdateCountObserver();
   observer4 = new UpdateCountObserver();
+
+  notificationObserver1 = new NotificationObserver(notificationObservable->notification1);
+  notificationObserver2 = new NotificationObserver(notificationObservable->notification2);
+
 }
 
@@ -139,4 +189,6 @@
   delete callObservable;
   delete superObservable;
+  delete blockObservable;
+  delete notificationObservable;
 
   delete observer1;
@@ -144,4 +196,6 @@
   delete observer3;
   delete observer4;
+  delete notificationObserver1;
+  delete notificationObserver2;
 }
 
@@ -198,4 +252,22 @@
   CPPUNIT_ASSERT_EQUAL( 2, observer1->updates );
   CPPUNIT_ASSERT_EQUAL( 2, observer2->updates );
+}
+
+void ObserverTest::doesNotifyTest(){
+  notificationObservable->signOn(notificationObserver1,
+                                 notificationObservable->notification1);
+  notificationObservable->signOn(notificationObserver2,
+                                 notificationObservable->notification2);
+
+  notificationObservable->operation1();
+  CPPUNIT_ASSERT(notificationObserver1->wasNotified);
+  CPPUNIT_ASSERT(!notificationObserver2->wasNotified);
+
+  notificationObserver1->wasNotified=false;
+
+  notificationObservable->operation2();
+  CPPUNIT_ASSERT(!notificationObserver1->wasNotified);
+  CPPUNIT_ASSERT(notificationObserver2->wasNotified);
+
 }
 
Index: src/unittests/ObserverTest.hpp
===================================================================
--- src/unittests/ObserverTest.hpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/ObserverTest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -13,8 +13,10 @@
 // forward declaration for test stubs
 class UpdateCountObserver;
+class NotificationObserver;
 class SimpleObservable;
 class CallObservable;
 class SuperObservable;
 class BlockObservable;
+class NotificationObservable;
 
 
@@ -25,4 +27,5 @@
   CPPUNIT_TEST ( doesBlockUpdateTest );
   CPPUNIT_TEST ( doesSubObservableTest );
+  CPPUNIT_TEST ( doesNotifyTest );
   CPPUNIT_TEST ( doesReportTest );
   CPPUNIT_TEST ( CircleDetectionTest );
@@ -36,4 +39,5 @@
   void doesBlockUpdateTest();
   void doesSubObservableTest();
+  void doesNotifyTest();
   void doesReportTest();
   void CircleDetectionTest();
@@ -45,4 +49,7 @@
   UpdateCountObserver *observer4;
 
+  NotificationObserver *notificationObserver1;
+  NotificationObserver *notificationObserver2;
+
   SimpleObservable *simpleObservable1;
   SimpleObservable *simpleObservable2;
@@ -50,4 +57,5 @@
   BlockObservable *blockObservable;
   SuperObservable *superObservable;
+  NotificationObservable *notificationObservable;
 };
 
Index: src/unittests/ParserUnitTest.cpp
===================================================================
--- src/unittests/ParserUnitTest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/ParserUnitTest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -107,5 +107,5 @@
   input << waterTremolo;
   testParser->load(&input);
-  CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(1))->x.x[0] == 3.0);
+  CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(1))->x[0] == 3.0);
   input.clear();
 }
@@ -120,5 +120,5 @@
   input << waterTremolo;
   testParser->load(&input);
-  CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(1))->v.x[0] == 3.0);
+  CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(1))->v[0] == 3.0);
   input.clear();
 }
Index: src/unittests/PlaneUnittest.cpp
===================================================================
--- src/unittests/PlaneUnittest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
+++ src/unittests/PlaneUnittest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -0,0 +1,157 @@
+/*
+ * PlaneUnittest.cpp
+ *
+ *  Created on: Apr 30, 2010
+ *      Author: crueger
+ */
+
+#include "PlaneUnittest.hpp"
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+#include "vector.hpp"
+
+CPPUNIT_TEST_SUITE_REGISTRATION( PlaneUnittest );
+
+void PlaneUnittest::setUp(){
+  p1 = new Plane(e1,e2,e3);
+  p2 = new Plane(e1,e2,zeroVec);
+  p3 = new Plane(e1,zeroVec,e3);
+  p4 = new Plane(zeroVec,e2,e3);
+}
+
+void PlaneUnittest::tearDown(){
+  delete p1;
+  delete p2;
+  delete p3;
+  delete p4;
+}
+
+void PlaneUnittest::constructionErrorTest(){
+  // try several method of construction..
+  // see if error checking works
+
+  // three points
+  CPPUNIT_ASSERT_NO_THROW(Plane(e1,e2,e3));
+  // when only two points are differnt this gives an error
+  CPPUNIT_ASSERT_THROW(Plane(e1,e2,e2),LinearDependenceException);
+  // same with only one point
+  CPPUNIT_ASSERT_THROW(Plane(e1,e1,e1),LinearDependenceException);
+
+  // use two vector giving two directions
+  CPPUNIT_ASSERT_NO_THROW(Plane(e1,e2,0));
+  // and again this is actually only one vector
+  CPPUNIT_ASSERT_THROW(Plane(e1,e1,0),LinearDependenceException);
+  // Zero vector does not give a good direction
+  CPPUNIT_ASSERT_THROW(Plane(e1,zeroVec,0),ZeroVectorException);
+
+  // use a normalvector and an scalar offset
+  CPPUNIT_ASSERT_NO_THROW(Plane(e1,0));
+  // The zero vector is no good as a normalvector
+  CPPUNIT_ASSERT_THROW(Plane(zeroVec,0),ZeroVectorException);
+
+  // use a normalvector and an offset vector
+  CPPUNIT_ASSERT_NO_THROW(Plane(e1,zeroVec));
+  // and the bad zeroVector again
+  CPPUNIT_ASSERT_THROW(Plane(zeroVec,zeroVec),ZeroVectorException);
+}
+
+
+// we need to test normals independent of the direction
+bool testNormal(const Vector &normal1, const Vector &normal2){
+  return (normal1==normal2) || (normal1==-1*normal2);
+}
+
+void PlaneUnittest::constructionResultTest(){
+  {
+    // construct with three points on plane
+    Plane p1(e1,e2,zeroVec);
+    CPPUNIT_ASSERT(testNormal(e3,p1.getNormal()));
+    CPPUNIT_ASSERT_EQUAL(0.,p1.getOffset());
+
+    Plane p2(e1,e3,zeroVec);
+    CPPUNIT_ASSERT(testNormal(e2,p2.getNormal()));
+    CPPUNIT_ASSERT_EQUAL(0.,p2.getOffset());
+
+    Plane p3(e2,e3,zeroVec);
+    CPPUNIT_ASSERT(testNormal(e1,p3.getNormal()));
+    CPPUNIT_ASSERT_EQUAL(0.,p3.getOffset());
+  }
+  {
+    // construct with two directions + offset
+    Plane p1(e1,e2,0);
+    CPPUNIT_ASSERT(testNormal(e3,p1.getNormal()));
+    CPPUNIT_ASSERT_EQUAL(0.,p1.getOffset());
+
+    Plane p2(e1,e3,0);
+    CPPUNIT_ASSERT(testNormal(e2,p2.getNormal()));
+    CPPUNIT_ASSERT_EQUAL(0.,p2.getOffset());
+
+    Plane p3(e2,e3,0);
+    CPPUNIT_ASSERT(testNormal(e1,p3.getNormal()));
+    CPPUNIT_ASSERT_EQUAL(0.,p3.getOffset());
+  }
+}
+
+void PlaneUnittest::pointsTest(){
+  std::vector<Vector> points1 = p1->getPointsOnPlane();
+  CPPUNIT_ASSERT(p1->isContained(points1[0]));
+  CPPUNIT_ASSERT(p1->isContained(points1[1]));
+  CPPUNIT_ASSERT(p1->isContained(points1[2]));
+  // check that the three points differ
+  CPPUNIT_ASSERT(points1[0]!=points1[1]);
+  CPPUNIT_ASSERT(points1[0]!=points1[2]);
+  CPPUNIT_ASSERT(points1[1]!=points1[2]);
+
+
+  std::vector<Vector> points2 = p2->getPointsOnPlane();
+  CPPUNIT_ASSERT(p2->isContained(points2[0]));
+  CPPUNIT_ASSERT(p2->isContained(points2[1]));
+  CPPUNIT_ASSERT(p2->isContained(points2[2]));
+  // check that the three points differ
+  CPPUNIT_ASSERT(points2[0]!=points2[1]);
+  CPPUNIT_ASSERT(points2[0]!=points2[2]);
+  CPPUNIT_ASSERT(points2[1]!=points2[2]);
+
+  std::vector<Vector> points3 = p3->getPointsOnPlane();
+  CPPUNIT_ASSERT(p3->isContained(points3[0]));
+  CPPUNIT_ASSERT(p3->isContained(points3[1]));
+  CPPUNIT_ASSERT(p3->isContained(points3[2]));
+  // check that the three points differ
+  CPPUNIT_ASSERT(points3[0]!=points3[1]);
+  CPPUNIT_ASSERT(points3[0]!=points3[2]);
+  CPPUNIT_ASSERT(points3[1]!=points3[2]);
+
+  std::vector<Vector> points4 = p4->getPointsOnPlane();
+  CPPUNIT_ASSERT(p4->isContained(points4[0]));
+  CPPUNIT_ASSERT(p4->isContained(points4[1]));
+  CPPUNIT_ASSERT(p4->isContained(points4[2]));
+  // check that the three points differ
+  CPPUNIT_ASSERT(points4[0]!=points4[1]);
+  CPPUNIT_ASSERT(points4[0]!=points4[2]);
+  CPPUNIT_ASSERT(points4[1]!=points4[2]);
+}
+
+
+void PlaneUnittest::operationsTest(){
+  {
+    Vector t = (1./3.)*(e1+e2+e3);
+    CPPUNIT_ASSERT(fabs(p1->distance(zeroVec)-t.Norm()) < MYEPSILON);
+    CPPUNIT_ASSERT_EQUAL(t,p1->getClosestPoint(zeroVec));
+  }
+
+  CPPUNIT_ASSERT(fabs(p2->distance(e3)-1) < MYEPSILON);
+  CPPUNIT_ASSERT_EQUAL(zeroVec,p2->getClosestPoint(e3));
+  CPPUNIT_ASSERT(fabs(p3->distance(e2)-1) < MYEPSILON);
+  CPPUNIT_ASSERT_EQUAL(zeroVec,p3->getClosestPoint(e2));
+  CPPUNIT_ASSERT(fabs(p4->distance(e1)-1) < MYEPSILON);
+  CPPUNIT_ASSERT_EQUAL(zeroVec,p4->getClosestPoint(e1));
+
+
+}
Index: src/unittests/PlaneUnittest.hpp
===================================================================
--- src/unittests/PlaneUnittest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
+++ src/unittests/PlaneUnittest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -0,0 +1,40 @@
+/*
+ * PlaneUnittest.hpp
+ *
+ *  Created on: Apr 30, 2010
+ *      Author: crueger
+ */
+
+#ifndef PLANEUNITTEST_HPP_
+#define PLANEUNITTEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "Plane.hpp"
+
+class PlaneUnittest : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE( PlaneUnittest) ;
+  CPPUNIT_TEST ( constructionErrorTest );
+  CPPUNIT_TEST ( constructionResultTest );
+  CPPUNIT_TEST ( pointsTest );
+  CPPUNIT_TEST ( operationsTest );
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+  void setUp();
+  void tearDown();
+
+  void constructionErrorTest();
+  void constructionResultTest();
+  void pointsTest();
+  void operationsTest();
+
+private:
+  Plane *p1;
+  Plane *p2;
+  Plane *p3;
+  Plane *p4;
+};
+
+#endif /* PLANEUNITTEST_HPP_ */
Index: src/unittests/analysisbondsunittest.cpp
===================================================================
--- src/unittests/analysisbondsunittest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/analysisbondsunittest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -69,21 +69,21 @@
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(1.5, 0., 1.5 );
+  *Walker->node = Vector(1.5, 0., 1.5 );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(0., 1.5, 1.5 );
+  *Walker->node = Vector(0., 1.5, 1.5 );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(1.5, 1.5, 0. );
+  *Walker->node = Vector(1.5, 1.5, 0. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(0., 0., 0. );
+  *Walker->node = Vector(0., 0., 0. );
   TestMolecule->AddAtom(Walker);
   Walker = World::getInstance().createAtom();
   Walker->type = carbon;
-  Walker->node->Init(0.5, 0.5, 0.5 );
+  *Walker->node = Vector(0.5, 0.5, 0.5 );
   TestMolecule->AddAtom(Walker);
 
Index: src/unittests/bondgraphunittest.cpp
===================================================================
--- src/unittests/bondgraphunittest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/bondgraphunittest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -21,4 +21,5 @@
 #include "bondgraph.hpp"
 #include "element.hpp"
+#include "log.hpp"
 #include "molecule.hpp"
 #include "periodentafel.hpp"
@@ -48,8 +49,12 @@
   hydrogen = new element;
   hydrogen->Z = 1;
+  hydrogen->CovalentRadius = 0.23;
+  hydrogen->VanDerWaalsRadius = 1.09;
   strcpy(hydrogen->name, "hydrogen");
   strcpy(hydrogen->symbol, "H");
   carbon = new element;
   carbon->Z = 2;
+  carbon->CovalentRadius = 0.68;
+  carbon->VanDerWaalsRadius = 1.7;
   strcpy(carbon->name, "carbon");
   strcpy(carbon->symbol, "C");
@@ -64,18 +69,21 @@
   TestMolecule = World::getInstance().createMolecule();
   Walker = World::getInstance().createAtom();
-  Walker->type = hydrogen;
-  Walker->node->Init(1., 0., 1. );
+  Walker->type = carbon;
+  *Walker->node = Vector(1., 0., 1. );
   TestMolecule->AddAtom(Walker);
+
   Walker = World::getInstance().createAtom();
-  Walker->type = hydrogen;
-  Walker->node->Init(0., 1., 1. );
+  Walker->type = carbon;
+  *Walker->node = Vector(0., 1., 1. );
   TestMolecule->AddAtom(Walker);
+
   Walker = World::getInstance().createAtom();
-  Walker->type = hydrogen;
-  Walker->node->Init(1., 1., 0. );
+  Walker->type = carbon;
+  *Walker->node = Vector(1., 1., 0. );
   TestMolecule->AddAtom(Walker);
+
   Walker = World::getInstance().createAtom();
-  Walker->type = hydrogen;
-  Walker->node->Init(0., 0., 0. );
+  Walker->type = carbon;
+  *Walker->node = Vector(0., 0., 0. );
   TestMolecule->AddAtom(Walker);
 
@@ -84,4 +92,5 @@
 
   // create a small file with table
+  dummyname = new string("dummy.dat");
   filename = new string("test.dat");
   ofstream test(filename->c_str());
@@ -99,4 +108,5 @@
   remove(filename->c_str());
   delete(filename);
+  delete(dummyname);
   delete(BG);
 
@@ -122,5 +132,5 @@
 /** UnitTest for BondGraphTest::ConstructBondGraph().
  */
-void BondGraphTest::ConstructGraphTest()
+void BondGraphTest::ConstructGraphFromTableTest()
 {
   atom *Walker = TestMolecule->start->next;
@@ -131,2 +141,15 @@
   CPPUNIT_ASSERT_EQUAL( true , Walker->IsBondedTo(Runner) );
 };
+
+/** UnitTest for BondGraphTest::ConstructBondGraph().
+ */
+void BondGraphTest::ConstructGraphFromCovalentRadiiTest()
+{
+  atom *Walker = TestMolecule->start->next;
+  atom *Runner = TestMolecule->end->previous;
+  CPPUNIT_ASSERT( TestMolecule->end != Walker );
+  CPPUNIT_ASSERT_EQUAL( false , BG->LoadBondLengthTable(*dummyname) );
+  CPPUNIT_ASSERT_EQUAL( true , BG->ConstructBondGraph(TestMolecule) );
+  CPPUNIT_ASSERT_EQUAL( true , Walker->IsBondedTo(Runner) );
+};
+
Index: src/unittests/bondgraphunittest.hpp
===================================================================
--- src/unittests/bondgraphunittest.hpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/bondgraphunittest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -23,5 +23,6 @@
     CPPUNIT_TEST_SUITE( BondGraphTest) ;
     CPPUNIT_TEST ( LoadTableTest );
-    CPPUNIT_TEST ( ConstructGraphTest );
+    CPPUNIT_TEST ( ConstructGraphFromTableTest );
+    CPPUNIT_TEST ( ConstructGraphFromCovalentRadiiTest );
     CPPUNIT_TEST_SUITE_END();
 
@@ -30,5 +31,6 @@
       void tearDown();
       void LoadTableTest();
-      void ConstructGraphTest();
+      void ConstructGraphFromTableTest();
+      void ConstructGraphFromCovalentRadiiTest();
 
 private:
@@ -41,4 +43,5 @@
       BondGraph *BG;
       string *filename;
+      string *dummyname;
 };
 
Index: src/unittests/gslvectorunittest.cpp
===================================================================
--- src/unittests/gslvectorunittest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/gslvectorunittest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -117,2 +117,48 @@
     CPPUNIT_ASSERT_EQUAL( (double)(3-j), v->Get(j) );
 };
+
+/** UnitTest for operators.
+ */
+void GSLVectorTest::OperatorIsTest()
+{
+  GSLVector zero(3);
+  GSLVector unit(3);
+  zero.SetZero();
+  unit.SetZero();
+  unit.Set(1,1.);
+  // summation and scaling
+  CPPUNIT_ASSERT_EQUAL( true, unit.IsOne() );
+  CPPUNIT_ASSERT_EQUAL( false, zero.IsOne() );
+  CPPUNIT_ASSERT_EQUAL( false, unit.IsZero() );
+  CPPUNIT_ASSERT_EQUAL( true, zero.IsZero() );
+};
+
+/** UnitTest for operators.
+ */
+void GSLVectorTest::OperatorAlgebraTest()
+{
+  GSLVector zero(3);
+  GSLVector unit(3);
+  zero.SetZero();
+  unit.SetZero();
+  unit.Set(1,1.);
+  // summation and scaling
+  CPPUNIT_ASSERT_EQUAL( true, (zero+unit).IsOne() );
+  CPPUNIT_ASSERT_EQUAL( true, (zero+unit).IsOne() );
+  CPPUNIT_ASSERT_EQUAL( true, (zero-unit).IsOne() );
+  CPPUNIT_ASSERT_EQUAL( false, (zero-unit).IsZero() );
+  CPPUNIT_ASSERT_EQUAL( true, (zero+zero).IsZero() );
+  CPPUNIT_ASSERT_EQUAL( false, (unit*0.98).IsOne() );
+  CPPUNIT_ASSERT_EQUAL( false, (0.98*unit).IsOne() );
+  CPPUNIT_ASSERT_EQUAL( true, (unit*1.).IsOne() );
+  CPPUNIT_ASSERT_EQUAL( true, (1.*unit).IsOne() );
+
+  CPPUNIT_ASSERT_EQUAL( unit, (zero+unit) );
+  CPPUNIT_ASSERT_EQUAL( zero, (zero+zero) );
+  CPPUNIT_ASSERT_EQUAL( unit, (unit+zero) );
+
+  unit += zero;
+  CPPUNIT_ASSERT_EQUAL( true, unit.IsOne() );
+  unit *= 1.;
+  CPPUNIT_ASSERT_EQUAL( true, unit.IsOne() );
+};
Index: src/unittests/gslvectorunittest.hpp
===================================================================
--- src/unittests/gslvectorunittest.hpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/gslvectorunittest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -22,4 +22,6 @@
     CPPUNIT_TEST (CopyTest );
     CPPUNIT_TEST (ExchangeTest );
+    CPPUNIT_TEST (OperatorAlgebraTest );
+    CPPUNIT_TEST (OperatorIsTest );
     CPPUNIT_TEST_SUITE_END();
 
@@ -32,4 +34,6 @@
     void CopyTest();
     void ExchangeTest();
+    void OperatorIsTest();
+    void OperatorAlgebraTest();
 
 private:
Index: src/unittests/listofbondsunittest.cpp
===================================================================
--- src/unittests/listofbondsunittest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/listofbondsunittest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -58,17 +58,17 @@
   Walker = World::getInstance().createAtom();
   Walker->type = hydrogen;
-  Walker->node->Init(1., 0., 1. );
-  TestMolecule->AddAtom(Walker);
-  Walker = World::getInstance().createAtom();
-  Walker->type = hydrogen;
-  Walker->node->Init(0., 1., 1. );
-  TestMolecule->AddAtom(Walker);
-  Walker = World::getInstance().createAtom();
-  Walker->type = hydrogen;
-  Walker->node->Init(1., 1., 0. );
-  TestMolecule->AddAtom(Walker);
-  Walker = World::getInstance().createAtom();
-  Walker->type = hydrogen;
-  Walker->node->Init(0., 0., 0. );
+  *Walker->node = Vector(1., 0., 1. );
+  TestMolecule->AddAtom(Walker);
+  Walker = World::getInstance().createAtom();
+  Walker->type = hydrogen;
+  *Walker->node = Vector(0., 1., 1. );
+  TestMolecule->AddAtom(Walker);
+  Walker = World::getInstance().createAtom();
+  Walker->type = hydrogen;
+  *Walker->node = Vector(1., 1., 0. );
+  TestMolecule->AddAtom(Walker);
+  Walker = World::getInstance().createAtom();
+  Walker->type = hydrogen;
+  *Walker->node = Vector(0., 0., 0. );
   TestMolecule->AddAtom(Walker);
 
Index: src/unittests/logunittest.cpp
===================================================================
--- src/unittests/logunittest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/logunittest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -41,15 +41,15 @@
 {
   logger::getInstance().setVerbosity(2);
-  Log() << Verbose(0) << "Verbosity level is set to 2." << endl;
-  Log() << Verbose(0) << "Test level 0" << endl;
-  Log() << Verbose(1) << "Test level 1" << endl;
-  Log() << Verbose(2) << "Test level 2" << endl;
-  Log() << Verbose(3) << "Test level 3" << endl;
-  Log() << Verbose(4) << "Test level 4" << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Verbosity level is set to 2." << endl);
+  DoLog(0) && (Log() << Verbose(0) << "Test level 0" << endl);
+  DoLog(1) && (Log() << Verbose(1) << "Test level 1" << endl);
+  DoLog(2) && (Log() << Verbose(2) << "Test level 2" << endl);
+  DoLog(3) && (Log() << Verbose(3) << "Test level 3" << endl);
+  DoLog(4) && (Log() << Verbose(4) << "Test level 4" << endl);
 
-  Log() << Verbose(0) << "Output a log message." << endl;
-  eLog() << Verbose(0) << "Output an error message." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Output a log message." << endl);
+  DoeLog(0) && (eLog()<< Verbose(0) << "Output an error message." << endl);
   setVerbosity(3);
-  Log() << Verbose(4) << "This should not be printed." << endl;
-  eLog() << Verbose(4) << "This should not be printed." << endl;
+  DoLog(4) && (Log() << Verbose(4) << "This should not be printed." << endl);
+  DoeLog(4) && (eLog()<< Verbose(4) << "This should not be printed." << endl);
 };
Index: src/unittests/memoryallocatorunittest.cpp
===================================================================
--- src/unittests/memoryallocatorunittest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/memoryallocatorunittest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -52,5 +52,5 @@
   char* buffer3 = NULL;
   buffer3 = Malloc<char>(4, "");
-  Log() << Verbose(0) << buffer3 << endl;
+  DoLog(0) && (Log() << Verbose(0) << buffer3 << endl);
   Free(&buffer3);
 
Index: src/unittests/tesselation_boundarytriangleunittest.cpp
===================================================================
--- src/unittests/tesselation_boundarytriangleunittest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/tesselation_boundarytriangleunittest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -86,49 +86,49 @@
 
   // simple test on y line
-  Point.Init(-1.,0.5,0.);
-  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.,0.5,0.);
-  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
-  Point.Init(-4.,0.5,0.);
+  Point = Vector(-1.,0.5,0.);
+  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
+  Point = Vector(0.,0.5,0.);
+  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
+  Point = Vector(-4.,0.5,0.);
   CPPUNIT_ASSERT_EQUAL( 16., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.,0.5,0.);
+  Point = Vector(0.,0.5,0.);
   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
 
   // simple test on x line
-  Point.Init(0.5,-1.,0.);
-  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.5,0.,0.);
-  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
-  Point.Init(0.5,-6.,0.);
+  Point = Vector(0.5,-1.,0.);
+  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
+  Point = Vector(0.5,0.,0.);
+  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
+  Point = Vector(0.5,-6.,0.);
   CPPUNIT_ASSERT_EQUAL( 36., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.5,0.,0.);
+  Point = Vector(0.5,0.,0.);
   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
 
   // simple test on slanted line
-  Point.Init(1.,1.,0.);
+  Point = Vector(1.,1.,0.);
   CPPUNIT_ASSERT_EQUAL( 0.5, triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.5,0.5,0.);
-  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
-  Point.Init(5.,5.,0.);
+  Point = Vector(0.5,0.5,0.);
+  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
+  Point = Vector(5.,5.,0.);
   CPPUNIT_ASSERT_EQUAL( 40.5, triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.5,0.5,0.);
+  Point = Vector(0.5,0.5,0.);
   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
 
   // simple test on first node
-  Point.Init(-1.,-1.,0.);
+  Point = Vector(-1.,-1.,0.);
   CPPUNIT_ASSERT_EQUAL( 2., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.,0.,0.);
+  Point = Vector(0.,0.,0.);
   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
 
   // simple test on second node
-  Point.Init(0.,2.,0.);
-  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.,1.,0.);
+  Point = Vector(0.,2.,0.);
+  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
+  Point = Vector(0.,1.,0.);
   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
 
   // simple test on third node
-  Point.Init(2.,0.,0.);
-  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(1.,0.,0.);
+  Point = Vector(2.,0.,0.);
+  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
+  Point = Vector(1.,0.,0.);
   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
 };
@@ -142,59 +142,59 @@
 
   // straight down/up
-  Point.Init(1./3.,1./3.,+5.);
+  Point = Vector(1./3.,1./3.,+5.);
   CPPUNIT_ASSERT_EQUAL( 25. , triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(1./3.,1./3.,0.);
-  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
-  Point.Init(1./3.,1./3.,-5.);
+  Point = Vector(1./3.,1./3.,0.);
+  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
+  Point = Vector(1./3.,1./3.,-5.);
   CPPUNIT_ASSERT_EQUAL( 25. , triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(1./3.,1./3.,0.);
+  Point = Vector(1./3.,1./3.,0.);
   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
 
   // simple test on y line
-  Point.Init(-1.,0.5,+2.);
+  Point = Vector(-1.,0.5,+2.);
   CPPUNIT_ASSERT_EQUAL( 5., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.,0.5,0.);
-  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
-  Point.Init(-1.,0.5,-3.);
+  Point = Vector(0.,0.5,0.);
+  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
+  Point = Vector(-1.,0.5,-3.);
   CPPUNIT_ASSERT_EQUAL( 10., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.,0.5,0.);
+  Point = Vector(0.,0.5,0.);
   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
 
   // simple test on x line
-  Point.Init(0.5,-1.,+1.);
+  Point = Vector(0.5,-1.,+1.);
   CPPUNIT_ASSERT_EQUAL( 2., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.5,0.,0.);
-  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
-  Point.Init(0.5,-1.,-2.);
+  Point = Vector(0.5,0.,0.);
+  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
+  Point = Vector(0.5,-1.,-2.);
   CPPUNIT_ASSERT_EQUAL( 5., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.5,0.,0.);
+  Point = Vector(0.5,0.,0.);
   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
 
   // simple test on slanted line
-  Point.Init(1.,1.,+3.);
+  Point = Vector(1.,1.,+3.);
   CPPUNIT_ASSERT_EQUAL( 9.5, triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.5,0.5,0.);
-  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
-  Point.Init(1.,1.,-4.);
+  Point = Vector(0.5,0.5,0.);
+  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
+  Point = Vector(1.,1.,-4.);
   CPPUNIT_ASSERT_EQUAL( 16.5, triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.5,0.5,0.);
+  Point = Vector(0.5,0.5,0.);
   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
 
   // simple test on first node
-  Point.Init(-1.,-1.,5.);
+  Point = Vector(-1.,-1.,5.);
   CPPUNIT_ASSERT_EQUAL( 27., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.,0.,0.);
+  Point = Vector(0.,0.,0.);
   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
 
   // simple test on second node
-  Point.Init(0.,2.,5.);
+  Point = Vector(0.,2.,5.);
   CPPUNIT_ASSERT_EQUAL( 26., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(0.,1.,0.);
+  Point = Vector(0.,1.,0.);
   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
 
   // simple test on third node
-  Point.Init(2.,0.,5.);
+  Point = Vector(2.,0.,5.);
   CPPUNIT_ASSERT_EQUAL( 26., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
-  Point.Init(1.,0.,0.);
-  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
-};
+  Point = Vector(1.,0.,0.);
+  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
+};
Index: src/unittests/tesselation_boundarytriangleunittest.hpp
===================================================================
--- src/unittests/tesselation_boundarytriangleunittest.hpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/tesselation_boundarytriangleunittest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -36,5 +36,5 @@
       class BoundaryPointSet *points[3];
       class TesselPoint *tesselpoints[3];
-      LinkedNodes Corners;
+      LinkedCell::LinkedNodes Corners;
 };
 
Index: src/unittests/tesselation_insideoutsideunittest.cpp
===================================================================
--- src/unittests/tesselation_insideoutsideunittest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/tesselation_insideoutsideunittest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -98,7 +98,7 @@
   while ((!TesselStruct->OpenLines.empty()) && (OneLoopWithoutSuccessFlag)) {
     // 2a. fill all new OpenLines
-    Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for candidates:" << endl;
+    DoLog(1) && (Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for candidates:" << endl);
     for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++)
-      Log() << Verbose(2) << *(Runner->second) << endl;
+      DoLog(2) && (Log() << Verbose(2) << *(Runner->second) << endl);
 
     for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) {
@@ -106,5 +106,5 @@
       if (baseline->pointlist.empty()) {
         T = (((baseline->BaseLine->triangles.begin()))->second);
-        Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl;
+        DoLog(1) && (Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl);
         TesselationFailFlag = TesselStruct->FindNextSuitableTriangle(*baseline, *T, SPHERERADIUS, LinkedList); //the line is there, so there is a triangle, but only one.
       }
@@ -113,7 +113,7 @@
     // 2b. search for smallest ShortestAngle among all candidates
     double ShortestAngle = 4.*M_PI;
-    Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:" << endl;
+    DoLog(1) && (Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:" << endl);
     for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++)
-      Log() << Verbose(2) << *(Runner->second) << endl;
+      DoLog(2) && (Log() << Verbose(2) << *(Runner->second) << endl);
 
     for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) {
@@ -127,5 +127,5 @@
       OneLoopWithoutSuccessFlag = false;
     else {
-      TesselStruct->AddCandidateTriangle(*baseline);
+      TesselStruct->AddCandidatePolygon(*baseline, SPHERERADIUS, LinkedList);
     }
   }
@@ -137,5 +137,5 @@
   delete(LinkedList);
   delete(TesselStruct);
-  for (LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) {
+  for (LinkedCell::LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) {
     delete((*Runner)->node);
     delete(*Runner);
Index: src/unittests/tesselation_insideoutsideunittest.hpp
===================================================================
--- src/unittests/tesselation_insideoutsideunittest.hpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/tesselation_insideoutsideunittest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -31,5 +31,5 @@
 private:
       class Tesselation *TesselStruct;
-      LinkedNodes Corners;
+      LinkedCell::LinkedNodes Corners;
       class LinkedCell *LinkedList;
 };
Index: src/unittests/tesselationunittest.cpp
===================================================================
--- src/unittests/tesselationunittest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/tesselationunittest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -95,5 +95,5 @@
       OneLoopWithoutSuccessFlag = false;
     else {
-      TesselStruct->AddCandidateTriangle(*baseline);
+      TesselStruct->AddCandidatePolygon(*baseline, SPHERERADIUS, LinkedList);
     }
   }
@@ -105,5 +105,5 @@
   delete(LinkedList);
   delete(TesselStruct);
-  for (LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) {
+  for (LinkedCell::LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) {
     delete((*Runner)->node);
     delete(*Runner);
Index: src/unittests/tesselationunittest.hpp
===================================================================
--- src/unittests/tesselationunittest.hpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/tesselationunittest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -34,5 +34,5 @@
 private:
       class Tesselation *TesselStruct;
-      LinkedNodes Corners;
+      LinkedCell::LinkedNodes Corners;
       class LinkedCell *LinkedList;
 };
Index: src/unittests/vectorunittest.cpp
===================================================================
--- src/unittests/vectorunittest.cpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/vectorunittest.cpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -17,5 +17,8 @@
 #include "memoryusageobserver.hpp"
 #include "vector.hpp"
+#include "vector_ops.hpp"
 #include "vectorunittest.hpp"
+#include "Plane.hpp"
+#include "Exceptions/LinearDependenceException.hpp"
 
 #ifdef HAVE_TESTRUNNER
@@ -23,4 +26,8 @@
 #endif /*HAVE_TESTRUNNER*/
 
+#include <iostream>
+
+using namespace std;
+
 /********************************************** Test classes **************************************/
 
@@ -31,9 +38,10 @@
 void VectorTest::setUp()
 {
-  zero.Init(0.,0.,0.);
-  unit.Init(1.,0.,0.);
-  otherunit.Init(0.,1.,0.);
-  notunit.Init(0.,1.,1.);
-  two.Init(2.,1.,0.);
+  zero  = Vector(0.,0.,0.);
+  unit = Vector(1.,0.,0.);
+  otherunit = Vector(0.,1.,0.);
+  notunit = Vector(0.,1.,1.);
+  two = Vector(2.,1.,0.);
+  three = Vector(1,2,3);
 };
 
@@ -66,40 +74,29 @@
   double factor;
   // copy vector
-  fixture.Init(2.,3.,4.);
+  fixture = Vector(2.,3.,4.);
   CPPUNIT_ASSERT_EQUAL( Vector(2.,3.,4.), fixture );
   // summation and scaling
-  fixture.CopyVector(&zero);
-  fixture.AddVector(&unit);
-  CPPUNIT_ASSERT_EQUAL( true, fixture.IsOne() );
-  fixture.CopyVector(&zero);
-  fixture.SubtractVector(&unit);
+  fixture = zero + unit;
+  CPPUNIT_ASSERT_EQUAL( true, fixture.IsOne() );
+  fixture = zero - unit;
   CPPUNIT_ASSERT_EQUAL( true, fixture.IsOne() );
   CPPUNIT_ASSERT_EQUAL( false, fixture.IsZero() );
-  fixture.CopyVector(&zero);
-  fixture.AddVector(&zero);
+  fixture = zero + zero;
   CPPUNIT_ASSERT_EQUAL( true, fixture.IsZero() );
-  fixture.CopyVector(&notunit);
-  fixture.SubtractVector(&otherunit);
-  CPPUNIT_ASSERT_EQUAL( true, fixture.IsOne() );
-  fixture.CopyVector(&unit);
-  fixture.AddVector(&otherunit);
+  fixture = notunit - otherunit;
+  CPPUNIT_ASSERT_EQUAL( true, fixture.IsOne() );
+  fixture = unit - otherunit;
   CPPUNIT_ASSERT_EQUAL( false, fixture.IsOne() );
-  fixture.CopyVector(&notunit);
-  fixture.SubtractVector(&unit);
-  fixture.SubtractVector(&otherunit);
+  fixture = notunit - unit - otherunit;
   CPPUNIT_ASSERT_EQUAL( false, fixture.IsZero() );
-  fixture.CopyVector(&unit);
-  fixture.Scale(0.98);
+  fixture = 0.98 * unit;
   CPPUNIT_ASSERT_EQUAL( false, fixture.IsOne() );
-  fixture.CopyVector(&unit);
-  fixture.Scale(1.);
-  CPPUNIT_ASSERT_EQUAL( true, fixture.IsOne() );
-  fixture.CopyVector(&unit);
+  fixture = 1. * unit;
+  CPPUNIT_ASSERT_EQUAL( true, fixture.IsOne() );
   factor = 0.98;
-  fixture.Scale(factor);
+  fixture = factor * unit;
   CPPUNIT_ASSERT_EQUAL( false, fixture.IsOne() );
-  fixture.CopyVector(&unit);
   factor = 1.;
-  fixture.Scale(factor);
+  fixture = factor * unit;
   CPPUNIT_ASSERT_EQUAL( true, fixture.IsOne() );
 };
@@ -131,15 +128,15 @@
 void VectorTest::EuclidianScalarProductTest()
 {
-  CPPUNIT_ASSERT_EQUAL( 0., zero.ScalarProduct(&zero) );
-  CPPUNIT_ASSERT_EQUAL( 0., zero.ScalarProduct(&unit) );
-  CPPUNIT_ASSERT_EQUAL( 0., zero.ScalarProduct(&otherunit) );
-  CPPUNIT_ASSERT_EQUAL( 0., zero.ScalarProduct(&notunit) );
-  CPPUNIT_ASSERT_EQUAL( 1., unit.ScalarProduct(&unit) );
-  CPPUNIT_ASSERT_EQUAL( 0., otherunit.ScalarProduct(&unit) );
-  CPPUNIT_ASSERT_EQUAL( 0., otherunit.ScalarProduct(&unit) );
-  CPPUNIT_ASSERT_EQUAL( 1., otherunit.ScalarProduct(&notunit) );
-  CPPUNIT_ASSERT_EQUAL( 2., two.ScalarProduct(&unit) );
-  CPPUNIT_ASSERT_EQUAL( 1., two.ScalarProduct(&otherunit) );
-  CPPUNIT_ASSERT_EQUAL( 1., two.ScalarProduct(&notunit) );
+  CPPUNIT_ASSERT_EQUAL( 0., zero.ScalarProduct(zero) );
+  CPPUNIT_ASSERT_EQUAL( 0., zero.ScalarProduct(unit) );
+  CPPUNIT_ASSERT_EQUAL( 0., zero.ScalarProduct(otherunit) );
+  CPPUNIT_ASSERT_EQUAL( 0., zero.ScalarProduct(notunit) );
+  CPPUNIT_ASSERT_EQUAL( 1., unit.ScalarProduct(unit) );
+  CPPUNIT_ASSERT_EQUAL( 0., otherunit.ScalarProduct(unit) );
+  CPPUNIT_ASSERT_EQUAL( 0., otherunit.ScalarProduct(unit) );
+  CPPUNIT_ASSERT_EQUAL( 1., otherunit.ScalarProduct(notunit) );
+  CPPUNIT_ASSERT_EQUAL( 2., two.ScalarProduct(unit) );
+  CPPUNIT_ASSERT_EQUAL( 1., two.ScalarProduct(otherunit) );
+  CPPUNIT_ASSERT_EQUAL( 1., two.ScalarProduct(notunit) );
 }
 
@@ -162,9 +159,9 @@
 void VectorTest::EuclidianDistancesTest()
 {
-  CPPUNIT_ASSERT_EQUAL( 1., zero.Distance(&unit) );
-  CPPUNIT_ASSERT_EQUAL( sqrt(2.), otherunit.Distance(&unit) );
-  CPPUNIT_ASSERT_EQUAL( sqrt(2.), zero.Distance(&notunit) );
-  CPPUNIT_ASSERT_EQUAL( 1., otherunit.Distance(&notunit) );
-  CPPUNIT_ASSERT_EQUAL( sqrt(5.), two.Distance(&notunit) );
+  CPPUNIT_ASSERT_EQUAL( 1., zero.distance(unit) );
+  CPPUNIT_ASSERT_EQUAL( sqrt(2.), otherunit.distance(unit) );
+  CPPUNIT_ASSERT_EQUAL( sqrt(2.), zero.distance(notunit) );
+  CPPUNIT_ASSERT_EQUAL( 1., otherunit.distance(notunit) );
+  CPPUNIT_ASSERT_EQUAL( sqrt(5.), two.distance(notunit) );
 }
 
@@ -173,9 +170,9 @@
 void VectorTest::EuclidianAnglesTest()
 {
-  CPPUNIT_ASSERT_EQUAL( M_PI, zero.Angle(&unit) );
-  CPPUNIT_ASSERT_EQUAL( 0., unit.Angle(&unit) );
-  CPPUNIT_ASSERT_EQUAL( true, fabs(M_PI/2. - otherunit.Angle(&unit)) < MYEPSILON );
-  CPPUNIT_ASSERT_EQUAL( true, fabs(M_PI/2. - unit.Angle(&notunit)) < MYEPSILON );
-  CPPUNIT_ASSERT_EQUAL( true, fabs(M_PI/4. - otherunit.Angle(&notunit)) < MYEPSILON );
+  CPPUNIT_ASSERT_EQUAL( M_PI, zero.Angle(unit) );
+  CPPUNIT_ASSERT_EQUAL( 0., unit.Angle(unit) );
+  CPPUNIT_ASSERT_EQUAL( true, fabs(M_PI/2. - otherunit.Angle(unit)) < MYEPSILON );
+  CPPUNIT_ASSERT_EQUAL( true, fabs(M_PI/2. - unit.Angle(notunit)) < MYEPSILON );
+  CPPUNIT_ASSERT_EQUAL( true, fabs(M_PI/4. - otherunit.Angle(notunit)) < MYEPSILON );
 };
 
@@ -184,9 +181,38 @@
 void VectorTest::ProjectionTest()
 {
-  CPPUNIT_ASSERT_EQUAL( zero, zero.Projection(&unit) );
-  CPPUNIT_ASSERT_EQUAL( zero, otherunit.Projection(&unit) );
-  CPPUNIT_ASSERT_EQUAL( Vector(0.4,0.2,0.),  otherunit.Projection(&two) );
-  CPPUNIT_ASSERT_EQUAL( Vector(0.,1.,0.),  two.Projection(&otherunit) );
-};
+  CPPUNIT_ASSERT_EQUAL( zero, zero.Projection(unit) );
+  CPPUNIT_ASSERT_EQUAL( zero, otherunit.Projection(unit) );
+  CPPUNIT_ASSERT_EQUAL( Vector(0.4,0.2,0.),  otherunit.Projection(two) );
+  CPPUNIT_ASSERT_EQUAL( Vector(0.,1.,0.),  two.Projection(otherunit) );
+};
+
+/**
+ * Unittest for operation with normals
+ */
+void VectorTest::NormalsTest(){
+  Vector testVector;
+  // the zero Vector should produce an error
+  CPPUNIT_ASSERT(!testVector.GetOneNormalVector(zero));
+
+  // first one-component system
+  CPPUNIT_ASSERT(testVector.GetOneNormalVector(unit));
+  CPPUNIT_ASSERT(testVector.ScalarProduct(unit) < MYEPSILON);
+
+  // second one-component system
+  CPPUNIT_ASSERT(testVector.GetOneNormalVector(otherunit));
+  CPPUNIT_ASSERT(testVector.ScalarProduct(otherunit) < MYEPSILON);
+
+  // first two-component system
+  CPPUNIT_ASSERT(testVector.GetOneNormalVector(notunit));
+  CPPUNIT_ASSERT(testVector.ScalarProduct(notunit) < MYEPSILON);
+
+  // second two-component system
+  CPPUNIT_ASSERT(testVector.GetOneNormalVector(two));
+  CPPUNIT_ASSERT(testVector.ScalarProduct(two) < MYEPSILON);
+
+  // three component system
+  CPPUNIT_ASSERT(testVector.GetOneNormalVector(three));
+  CPPUNIT_ASSERT(testVector.ScalarProduct(three) < MYEPSILON);
+}
 
 /** UnitTest for line intersections.
@@ -195,73 +221,64 @@
 {
   // plane at (0,0,0) normal to (1,0,0) cuts line from (0,0,0) to (2,1,0) at ???
-  CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionWithPlane(&unit, &zero, &zero, &two) );
+  CPPUNIT_ASSERT_NO_THROW(fixture = Plane(unit, zero).GetIntersection(zero, two) );
   CPPUNIT_ASSERT_EQUAL( zero, fixture );
 
   // plane at (2,1,0) normal to (0,1,0) cuts line from (1,0,0) to (0,1,1) at ???
-  CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionWithPlane(&otherunit, &two, &unit, &notunit) );
+  CPPUNIT_ASSERT_NO_THROW(fixture = Plane(otherunit, two).GetIntersection( unit, notunit) );
   CPPUNIT_ASSERT_EQUAL( Vector(0., 1., 1.), fixture );
 
   // four vectors equal to zero
-  CPPUNIT_ASSERT_EQUAL( false, fixture.GetIntersectionOfTwoLinesOnPlane(&zero, &zero, &zero, &zero, NULL) );
+  CPPUNIT_ASSERT_THROW(fixture = GetIntersectionOfTwoLinesOnPlane(zero, zero, zero, zero), LinearDependenceException);
+  //CPPUNIT_ASSERT_EQUAL( zero, fixture );
+
+  // four vectors equal to unit
+  CPPUNIT_ASSERT_THROW(fixture = GetIntersectionOfTwoLinesOnPlane(unit, unit, unit, unit), LinearDependenceException);
+  //CPPUNIT_ASSERT_EQUAL( zero, fixture );
+
+  // two equal lines
+  CPPUNIT_ASSERT_NO_THROW(fixture = GetIntersectionOfTwoLinesOnPlane(unit, two, unit, two));
+  CPPUNIT_ASSERT_EQUAL( unit, fixture );
+
+  // line from (1,0,0) to (2,1,0) cuts line from (1,0,0) to (0,1,0) at ???
+  CPPUNIT_ASSERT_NO_THROW( fixture = GetIntersectionOfTwoLinesOnPlane(unit, two, unit, otherunit) );
+  CPPUNIT_ASSERT_EQUAL( unit, fixture );
+
+  // line from (1,0,0) to (0,0,0) cuts line from (0,0,0) to (2,1,0) at ???
+  CPPUNIT_ASSERT_NO_THROW( fixture = GetIntersectionOfTwoLinesOnPlane(unit, zero, zero, two) );
   CPPUNIT_ASSERT_EQUAL( zero, fixture );
 
-  // four vectors equal to unit
-  CPPUNIT_ASSERT_EQUAL( false, fixture.GetIntersectionOfTwoLinesOnPlane(&unit, &unit, &unit, &unit, NULL) );
+  // line from (1,0,0) to (2,1,0) cuts line from (0,0,0) to (0,1,0) at ???
+  CPPUNIT_ASSERT_NO_THROW(fixture = GetIntersectionOfTwoLinesOnPlane(unit, two, zero, otherunit) );
+  CPPUNIT_ASSERT_EQUAL( Vector(0., -1., 0.), fixture );
+};
+
+/** UnitTest for vector rotations.
+ */
+void VectorTest::VectorRotationTest()
+{
+  fixture = Vector(-1.,0.,0.);
+
+  // zero vector does not change
+  fixture = RotateVector(zero,unit, 1.);
   CPPUNIT_ASSERT_EQUAL( zero, fixture );
 
-  // two equal lines
-  CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionOfTwoLinesOnPlane(&unit, &two, &unit, &two, NULL) );
+  fixture = RotateVector(zero, two, 1.);
+  CPPUNIT_ASSERT_EQUAL( zero,  fixture);
+
+  // vector on axis does not change
+  fixture = RotateVector(unit,unit, 1.);
   CPPUNIT_ASSERT_EQUAL( unit, fixture );
 
-  // line from (1,0,0) to (2,1,0) cuts line from (1,0,0) to (0,1,0) at ???
-  CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionOfTwoLinesOnPlane(&unit, &two, &unit, &otherunit, NULL) );
-  CPPUNIT_ASSERT_EQUAL( unit, fixture );
-
-  // line from (1,0,0) to (0,0,0) cuts line from (0,0,0) to (2,1,0) at ???
-  CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionOfTwoLinesOnPlane(&unit, &zero, &zero, &two, NULL) );
-  CPPUNIT_ASSERT_EQUAL( zero, fixture );
-
-  // line from (1,0,0) to (2,1,0) cuts line from (0,0,0) to (0,1,0) at ???
-  CPPUNIT_ASSERT_EQUAL( true, fixture.GetIntersectionOfTwoLinesOnPlane(&unit, &two, &zero, &otherunit, NULL) );
-  CPPUNIT_ASSERT_EQUAL( Vector(0., -1., 0.), fixture );
-};
-
-/** UnitTest for vector rotations.
- */
-void VectorTest::VectorRotationTest()
-{
-  fixture.Init(-1.,0.,0.);
-
-  // zero vector does not change
-  fixture.CopyVector(&zero);
-  fixture.RotateVector(&unit, 1.);
-  CPPUNIT_ASSERT_EQUAL( zero, fixture );
-
-  fixture.RotateVector(&two, 1.);
-  CPPUNIT_ASSERT_EQUAL( zero,  fixture);
-
-  // vector on axis does not change
-  fixture.CopyVector(&unit);
-  fixture.RotateVector(&unit, 1.);
-  CPPUNIT_ASSERT_EQUAL( unit, fixture );
-
-  fixture.RotateVector(&unit, 1.);
-  CPPUNIT_ASSERT_EQUAL( unit, fixture );
-
   // rotations
-  fixture.CopyVector(&otherunit);
-  fixture.RotateVector(&unit, M_PI);
+  fixture = RotateVector(otherunit, unit, M_PI);
   CPPUNIT_ASSERT_EQUAL( Vector(0.,-1.,0.), fixture );
 
-  fixture.CopyVector(&otherunit);
-  fixture.RotateVector(&unit, 2. * M_PI);
+  fixture = RotateVector(otherunit, unit, 2. * M_PI);
   CPPUNIT_ASSERT_EQUAL( otherunit, fixture );
 
-  fixture.CopyVector(&otherunit);
-  fixture.RotateVector(&unit, 0);
+  fixture = RotateVector(otherunit,unit, 0);
   CPPUNIT_ASSERT_EQUAL( otherunit, fixture );
 
-  fixture.Init(0.,0.,1.);
-  fixture.RotateVector(&notunit, M_PI);
+  fixture = RotateVector(Vector(0.,0.,1.), notunit, M_PI);
   CPPUNIT_ASSERT_EQUAL( otherunit, fixture );
 }
@@ -283,17 +300,17 @@
   parallelepiped[8] = 1;
 
-  fixture.CopyVector(zero);
+  fixture = zero;
   CPPUNIT_ASSERT_EQUAL( false, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
-  fixture.Init(2.5,2.5,2.5);
+  fixture = Vector(2.5,2.5,2.5);
   CPPUNIT_ASSERT_EQUAL( true, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
-  fixture.Init(1.,1.,1.);
+  fixture = Vector(1.,1.,1.);
   CPPUNIT_ASSERT_EQUAL( false, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
-  fixture.Init(3.5,3.5,3.5);
+  fixture = Vector(3.5,3.5,3.5);
   CPPUNIT_ASSERT_EQUAL( false, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
-  fixture.Init(2.,2.,2.);
+  fixture = Vector(2.,2.,2.);
   CPPUNIT_ASSERT_EQUAL( true, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
-  fixture.Init(2.,3.,2.);
+  fixture = Vector(2.,3.,2.);
   CPPUNIT_ASSERT_EQUAL( true, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
-  fixture.Init(-2.,2.,-1.);
+  fixture = Vector(-2.,2.,-1.);
   CPPUNIT_ASSERT_EQUAL( false, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
 }
Index: src/unittests/vectorunittest.hpp
===================================================================
--- src/unittests/vectorunittest.hpp	(revision b8d4a36310666e7e35fa9d7064e994e48d9b0e54)
+++ src/unittests/vectorunittest.hpp	(revision a2ab15ba2cc94cbece043d75b16c7c3e7c81f308)
@@ -26,4 +26,5 @@
     CPPUNIT_TEST ( EuclidianAnglesTest );
     CPPUNIT_TEST ( ProjectionTest );
+    CPPUNIT_TEST ( NormalsTest );
     CPPUNIT_TEST ( LineIntersectionTest );
     CPPUNIT_TEST ( VectorRotationTest );
@@ -43,4 +44,5 @@
     void EuclidianAnglesTest();
     void ProjectionTest();
+    void NormalsTest();
     void LineIntersectionTest();
     void VectorRotationTest();
@@ -56,4 +58,5 @@
     Vector notunit;
     Vector two;
+    Vector three;
 };
 
