Index: src/analysis_correlation.cpp
===================================================================
--- src/analysis_correlation.cpp	(revision eecd33b33ccae6f7857db923f518303f399dde1c)
+++ src/analysis_correlation.cpp	(revision a5551b36831494b1f744d79223d87e97b7be6f5c)
@@ -14,4 +14,5 @@
 #include "tesselationhelpers.hpp"
 #include "vector.hpp"
+#include "verbose.hpp"
 
 
@@ -19,35 +20,45 @@
  * Note given element order is unimportant (i.e. g(Si, O) === g(O, Si))
  * \param *out output stream for debugging
- * \param *mol molecule with atoms
+ * \param *molecules list of molecules structure
  * \param *type1 first element or NULL (if any element)
  * \param *type2 second element or NULL (if any element)
  * \return Map of doubles with values the pair of the two atoms.
  */
-PairCorrelationMap *PairCorrelation( const ofstream *out, const molecule * const mol, const element * const type1, const element * const type2 )
+PairCorrelationMap *PairCorrelation( ofstream * const out, MoleculeListClass * const &molecules, const element * const type1, const element * const type2 )
 {
   PairCorrelationMap *outmap = NULL;
   double distance = 0.;
 
-  if ((mol == NULL)) {
-    cout << "No molecule given." << endl;
+  if (molecules->ListOfMolecules.empty()) {
+    cerr << Verbose(1) <<"No molecule given." << endl;
     return outmap;
   }
   outmap = new PairCorrelationMap;
-  atom *Walker = mol->start;
-  while (Walker->next != mol->end) {
-    Walker = Walker->next;
-    if ((type1 == NULL) || (Walker->type == type1)) {
-      atom *OtherWalker = mol->start;
-      while (OtherWalker->next != mol->end) { // only go up to Walker
-        OtherWalker = OtherWalker->next;
-        if (Walker->nr < OtherWalker->nr)
-          if ((type2 == NULL) || (OtherWalker->type == type2)) {
-            distance = Walker->node->Distance(OtherWalker->node);
-            //cout << "Inserting " << *Walker << " and " << *OtherWalker << endl;
-            outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) );
+  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
+    if ((*MolWalker)->ActiveFlag) {
+      cerr << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
+      atom *Walker = (*MolWalker)->start;
+      while (Walker->next != (*MolWalker)->end) {
+        Walker = Walker->next;
+        *out << Verbose(3) << "Current atom is " << *Walker << "." << endl;
+        if ((type1 == NULL) || (Walker->type == type1)) {
+          for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++)
+            if ((*MolOtherWalker)->ActiveFlag) {
+              *out << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl;
+              atom *OtherWalker = (*MolOtherWalker)->start;
+              while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker
+                OtherWalker = OtherWalker->next;
+                *out << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl;
+                if (Walker->nr < OtherWalker->nr)
+                  if ((type2 == NULL) || (OtherWalker->type == type2)) {
+                    distance = Walker->node->Distance(OtherWalker->node);
+                    //*out << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl;
+                    outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) );
+                  }
+              }
           }
+        }
       }
     }
-  }
 
   return outmap;
@@ -56,27 +67,33 @@
 /** Calculates the distance (pair) correlation between a given element and a point.
  * \param *out output stream for debugging
- * \param *mol molecule with atoms
+ * \param *molecules list of molecules structure
  * \param *type element or NULL (if any element)
  * \param *point vector to the correlation point
  * \return Map of dobules with values as pairs of atom and the vector
  */
-CorrelationToPointMap *CorrelationToPoint( const ofstream *out, const molecule * const mol, const element * const type, const Vector *point )
+CorrelationToPointMap *CorrelationToPoint(  ofstream * const out, MoleculeListClass * const &molecules, const element * const type, const Vector *point )
 {
   CorrelationToPointMap *outmap = NULL;
   double distance = 0.;
 
-  if ((mol == NULL)) {
-    cout << "No molecule given." << endl;
+  if (molecules->ListOfMolecules.empty()) {
+    *out << Verbose(1) <<"No molecule given." << endl;
     return outmap;
   }
   outmap = new CorrelationToPointMap;
-  atom *Walker = mol->start;
-  while (Walker->next != mol->end) {
-    Walker = Walker->next;
-    if ((type == NULL) || (Walker->type == type)) {
-      distance = Walker->node->Distance(point);
-      outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
+  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
+    if ((*MolWalker)->ActiveFlag) {
+      *out << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
+      atom *Walker = (*MolWalker)->start;
+      while (Walker->next != (*MolWalker)->end) {
+        Walker = Walker->next;
+        *out << Verbose(3) << "Current atom is " << *Walker << "." << endl;
+        if ((type == NULL) || (Walker->type == type)) {
+          distance = Walker->node->Distance(point);
+          *out << Verbose(4) << "Current distance is " << distance << "." << endl;
+          outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
+        }
+      }
     }
-  }
 
   return outmap;
@@ -85,5 +102,5 @@
 /** Calculates the distance (pair) correlation between a given element and a surface.
  * \param *out output stream for debugging
- * \param *mol molecule with atoms
+ * \param *molecules list of molecules structure
  * \param *type element or NULL (if any element)
  * \param *Surface pointer to Tesselation class surface
@@ -91,7 +108,6 @@
  * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest
  */
-CorrelationToSurfaceMap *CorrelationToSurface( ofstream *out, const molecule * const mol, const element * const type, const Tesselation * const Surface, const LinkedCell *LC )
-{
-
+CorrelationToSurfaceMap *CorrelationToSurface( ofstream * const out, MoleculeListClass * const &molecules, const element * const type, const Tesselation * const Surface, const LinkedCell *LC )
+{
   CorrelationToSurfaceMap *outmap = NULL;
   double distance = 0.;
@@ -99,20 +115,25 @@
   Vector centroid;
 
-  if ((Surface == NULL) || (LC == NULL) || (mol == NULL)) {
-    cout << "No Tesselation, no LinkedCell or no molecule given." << endl;
+  if ((Surface == NULL) || (LC == NULL) || (molecules->ListOfMolecules.empty())) {
+    *out << Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl;
     return outmap;
   }
   outmap = new CorrelationToSurfaceMap;
-  atom *Walker = mol->start;
-  while (Walker->next != mol->end) {
-    Walker = Walker->next;
-    if ((type == NULL) || (Walker->type == type)) {
-      triangle = Surface->FindClosestTriangleToPoint(out, Walker->node, LC );
-      if (triangle != NULL) {
-        distance = DistanceToTrianglePlane(out, Walker->node, triangle);
-        outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(distance, pair<atom *, BoundaryTriangleSet*> (Walker, triangle) ) );
+  for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
+    if ((*MolWalker)->ActiveFlag) {
+      *out << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
+      atom *Walker = (*MolWalker)->start;
+      while (Walker->next != (*MolWalker)->end) {
+        Walker = Walker->next;
+        *out << Verbose(3) << "Current atom is " << *Walker << "." << endl;
+        if ((type == NULL) || (Walker->type == type)) {
+          triangle = Surface->FindClosestTriangleToPoint(out, Walker->node, LC );
+          if (triangle != NULL) {
+            distance = DistanceToTrianglePlane(out, Walker->node, triangle);
+            outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(distance, pair<atom *, BoundaryTriangleSet*> (Walker, triangle) ) );
+          }
+        }
       }
     }
-  }
 
   return outmap;
@@ -135,5 +156,5 @@
  * \param *map map to write
  */
-void OutputCorrelation( ofstream *file, const BinPairMap * const map )
+void OutputCorrelation( ofstream * const file, const BinPairMap * const map )
 {
   *file << "# BinStart\tCount" << endl;
@@ -147,5 +168,5 @@
  * \param *map map to write
  */
-void OutputPairCorrelation( ofstream *file, const PairCorrelationMap * const map )
+void OutputPairCorrelation( ofstream * const file, const PairCorrelationMap * const map )
 {
   *file << "# BinStart\tAtom1\tAtom2" << endl;
@@ -159,5 +180,5 @@
  * \param *map map to write
  */
-void OutputCorrelationToPoint( ofstream *file, const CorrelationToPointMap * const map )
+void OutputCorrelationToPoint( ofstream * const file, const CorrelationToPointMap * const map )
 {
   *file << "# BinStart\tAtom::x[i]-point.x[i]" << endl;
@@ -174,5 +195,5 @@
  * \param *map map to write
  */
-void OutputCorrelationToSurface( ofstream *file, const CorrelationToSurfaceMap * const map )
+void OutputCorrelationToSurface( ofstream * const file, const CorrelationToSurfaceMap * const map )
 {
   *file << "# BinStart\tTriangle" << endl;
Index: src/analysis_correlation.hpp
===================================================================
--- src/analysis_correlation.hpp	(revision eecd33b33ccae6f7857db923f518303f399dde1c)
+++ src/analysis_correlation.hpp	(revision a5551b36831494b1f744d79223d87e97b7be6f5c)
@@ -32,5 +32,5 @@
 class element;
 class LinkedCell;
-class molecule;
+class MoleculeListClass;
 class Tesselation;
 class Vector;
@@ -45,12 +45,12 @@
 /********************************************** declarations *******************************/
 
-PairCorrelationMap *PairCorrelation( const ofstream *out, const molecule * const mol, const element * const type1, const element * const  type2 );
-CorrelationToPointMap *CorrelationToPoint( const ofstream *out, const molecule * const mol, const element * const type, const Vector *point );
-CorrelationToSurfaceMap *CorrelationToSurface( ofstream *out, const molecule * const mol, const element * const type, const Tesselation * const Surface, const LinkedCell *LC );
+PairCorrelationMap *PairCorrelation( ofstream * const out, MoleculeListClass * const &molecules, const element * const type1, const element * const  type2 );
+CorrelationToPointMap *CorrelationToPoint( ofstream * const out, MoleculeListClass * const &molecules, const element * const type, const Vector *point );
+CorrelationToSurfaceMap *CorrelationToSurface( ofstream * const out, MoleculeListClass * const &molecules, const element * const type, const Tesselation * const Surface, const LinkedCell *LC );
 double GetBin ( const double value, const double BinWidth, const double BinStart );
-void OutputCorrelation( ofstream *file, const BinPairMap * const map );
-void OutputPairCorrelation( ofstream *file, const BinPairMap * const map );
-void OutputCorrelationToPoint( ofstream *file, const BinPairMap * const map );
-void OutputCorrelationToSurface( ofstream *file, const BinPairMap * const map );
+void OutputCorrelation( ofstream * const file, const BinPairMap * const map );
+void OutputPairCorrelation( ofstream * const file, const BinPairMap * const map );
+void OutputCorrelationToPoint( ofstream * const file, const BinPairMap * const map );
+void OutputCorrelationToSurface( ofstream * const file, const BinPairMap * const map );
 
 
Index: src/builder.cpp
===================================================================
--- src/builder.cpp	(revision eecd33b33ccae6f7857db923f518303f399dde1c)
+++ src/builder.cpp	(revision a5551b36831494b1f744d79223d87e97b7be6f5c)
@@ -1616,17 +1616,28 @@
                 const LinkedCell *LCList = NULL;
                 // find biggest molecule
+                int counter  = 0;
                 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
                   if ((Boundary == NULL) || (Boundary->AtomCount < (*BigFinder)->AtomCount)) {
                     Boundary = *BigFinder;
                   }
+                  counter++;
+                }
+                bool *Actives = Malloc<bool>(counter, "ParseCommandLineOptions() - case C -- *Actives");
+                counter = 0;
+                for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {
+                  Actives[counter] = (*BigFinder)->ActiveFlag;
+                  (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true;
                 }
                 LCList = new LinkedCell(Boundary, 2.*radius);
                 element *elemental = periode->FindElement((const int) atoi(argv[argptr]));
                 FindNonConvexBorder((ofstream *)&cout, Boundary, TesselStruct, LCList, radius, NULL);
-                CorrelationToSurfaceMap *surfacemap = CorrelationToSurface( (ofstream *)&cout, mol, elemental, TesselStruct, LCList );
+                CorrelationToSurfaceMap *surfacemap = CorrelationToSurface( (ofstream *)&cout, molecules, elemental, TesselStruct, LCList );
                 BinPairMap *binmap = BinData( (ofstream *)&cout, surfacemap, 0.5, 0., 0. );
                 OutputCorrelation ( &binoutput, binmap );
                 output.close();
                 binoutput.close();
+                for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++)
+                  (*BigFinder)->ActiveFlag = Actives[counter];
+                Free(&Actives);
                 delete(LCList);
                 delete(TesselStruct);
Index: src/unittests/AnalysisCorrelationToPointUnitTest.cpp
===================================================================
--- src/unittests/AnalysisCorrelationToPointUnitTest.cpp	(revision eecd33b33ccae6f7857db923f518303f399dde1c)
+++ src/unittests/AnalysisCorrelationToPointUnitTest.cpp	(revision a5551b36831494b1f744d79223d87e97b7be6f5c)
@@ -33,4 +33,5 @@
 
   // init private all pointers to zero
+  TestList = NULL;
   TestMolecule = NULL;
   hydrogen = NULL;
@@ -73,9 +74,13 @@
   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
 
+  TestList = new MoleculeListClass;
+  TestMolecule->ActiveFlag = true;
+  TestList->insert(TestMolecule);
+
   // init point
   point = new Vector(1.,1.,1.);
 
   // init maps
-  pointmap = CorrelationToPoint( (ofstream *)&cout, (const molecule * const)TestMolecule, (const element * const)hydrogen, (const Vector *)point );
+  pointmap = CorrelationToPoint( (ofstream *)&cout, (MoleculeListClass * const)TestList, (const element * const)hydrogen, (const Vector *)point );
   binmap = NULL;
 
@@ -91,5 +96,5 @@
 
   // remove
-  delete(TestMolecule);
+  delete(TestList);
   // note that all the atoms are cleaned by TestMolecule
   delete(point);
Index: src/unittests/AnalysisCorrelationToPointUnitTest.hpp
===================================================================
--- src/unittests/AnalysisCorrelationToPointUnitTest.hpp	(revision eecd33b33ccae6f7857db923f518303f399dde1c)
+++ src/unittests/AnalysisCorrelationToPointUnitTest.hpp	(revision a5551b36831494b1f744d79223d87e97b7be6f5c)
@@ -12,6 +12,7 @@
 
 class element;
+class LinkedCell;
 class molecule;
-class LinkedCell;
+class MoleculeListClass;
 class periodentafel;
 class Tesselation;
@@ -37,4 +38,5 @@
 private:
 
+      MoleculeListClass *TestList;
       molecule *TestMolecule;
       element *hydrogen;
Index: src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
===================================================================
--- src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp	(revision eecd33b33ccae6f7857db923f518303f399dde1c)
+++ src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp	(revision a5551b36831494b1f744d79223d87e97b7be6f5c)
@@ -33,4 +33,5 @@
 
   // init private all pointers to zero
+  TestList = NULL;
   TestMolecule = NULL;
   hydrogen = NULL;
@@ -40,5 +41,4 @@
   Surface = NULL;
   LC = NULL;
-
 
   // construct element
@@ -79,4 +79,8 @@
   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
 
+  TestList = new MoleculeListClass;
+  TestMolecule->ActiveFlag = true;
+  TestList->insert(TestMolecule);
+
   // init tesselation and linked cell
   Surface = new Tesselation;
@@ -121,5 +125,5 @@
 
   // remove
-  delete(TestMolecule);
+  delete(TestList);
   delete(Surface);
   // note that all the atoms are cleaned by TestMolecule
@@ -133,5 +137,5 @@
 {
   // do the pair correlation
-  surfacemap = CorrelationToSurface( (ofstream *)&cout, TestMolecule, hydrogen, Surface, LC );
+  surfacemap = CorrelationToSurface( (ofstream *)&cout, TestList, hydrogen, Surface, LC );
   CPPUNIT_ASSERT( surfacemap != NULL );
   CPPUNIT_ASSERT_EQUAL( (size_t)4, surfacemap->size() );
@@ -141,5 +145,5 @@
 {
   BinPairMap::iterator tester;
-  surfacemap = CorrelationToSurface( (ofstream *)&cout, TestMolecule, hydrogen, Surface, LC );
+  surfacemap = CorrelationToSurface( (ofstream *)&cout, TestList, hydrogen, Surface, LC );
   // put pair correlation into bins and check with no range
   binmap = BinData( (ofstream *)&cout, surfacemap, 0.5, 0., 0. );
@@ -155,5 +159,5 @@
 {
   BinPairMap::iterator tester;
-  surfacemap = CorrelationToSurface( (ofstream *)&cout, TestMolecule, hydrogen, Surface, LC );
+  surfacemap = CorrelationToSurface( (ofstream *)&cout, TestList, hydrogen, Surface, LC );
   // ... and check with [0., 2.] range
   binmap = BinData( (ofstream *)&cout, surfacemap, 0.5, 0., 2. );
@@ -172,5 +176,5 @@
 {
   BinPairMap::iterator tester;
-  surfacemap = CorrelationToSurface( (ofstream *)&cout, TestMolecule, carbon, Surface, LC );
+  surfacemap = CorrelationToSurface( (ofstream *)&cout, TestList, carbon, Surface, LC );
   // put pair correlation into bins and check with no range
   binmap = BinData( (ofstream *)&cout, surfacemap, 0.5, 0., 0. );
@@ -190,5 +194,5 @@
 {
   BinPairMap::iterator tester;
-  surfacemap = CorrelationToSurface( (ofstream *)&cout, TestMolecule, carbon, Surface, LC );
+  surfacemap = CorrelationToSurface( (ofstream *)&cout, TestList, carbon, Surface, LC );
   // ... and check with [0., 2.] range
   binmap = BinData( (ofstream *)&cout, surfacemap, 0.5, -2., 4. );
Index: src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp
===================================================================
--- src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp	(revision eecd33b33ccae6f7857db923f518303f399dde1c)
+++ src/unittests/AnalysisCorrelationToSurfaceUnitTest.hpp	(revision a5551b36831494b1f744d79223d87e97b7be6f5c)
@@ -12,6 +12,7 @@
 
 class element;
+class LinkedCell;
 class molecule;
-class LinkedCell;
+class MoleculeListClass;
 class periodentafel;
 class Tesselation;
@@ -40,4 +41,5 @@
 private:
 
+      MoleculeListClass *TestList;
       molecule *TestMolecule;
       element *hydrogen;
Index: src/unittests/AnalysisPairCorrelationUnitTest.cpp
===================================================================
--- src/unittests/AnalysisPairCorrelationUnitTest.cpp	(revision eecd33b33ccae6f7857db923f518303f399dde1c)
+++ src/unittests/AnalysisPairCorrelationUnitTest.cpp	(revision a5551b36831494b1f744d79223d87e97b7be6f5c)
@@ -34,4 +34,5 @@
 
   // init private all pointers to zero
+  TestList = NULL;
   TestMolecule = NULL;
   hydrogen = NULL;
@@ -72,6 +73,10 @@
   CPPUNIT_ASSERT_EQUAL( TestMolecule->AtomCount, 4 );
 
+  TestList = new MoleculeListClass;
+  TestMolecule->ActiveFlag = true;
+  TestList->insert(TestMolecule);
+
   // init maps
-  correlationmap = PairCorrelation( (ofstream *)&cout, TestMolecule, hydrogen, hydrogen );
+  correlationmap = PairCorrelation( (ofstream *)&cout, TestList, hydrogen, hydrogen );
   binmap = NULL;
 
@@ -87,5 +92,5 @@
 
   // remove
-  delete(TestMolecule);
+  delete(TestList);
   // note that all the atoms are cleaned by TestMolecule
   delete(tafel);
Index: src/unittests/AnalysisPairCorrelationUnitTest.hpp
===================================================================
--- src/unittests/AnalysisPairCorrelationUnitTest.hpp	(revision eecd33b33ccae6f7857db923f518303f399dde1c)
+++ src/unittests/AnalysisPairCorrelationUnitTest.hpp	(revision a5551b36831494b1f744d79223d87e97b7be6f5c)
@@ -12,6 +12,7 @@
 
 class element;
+class LinkedCell;
 class molecule;
-class LinkedCell;
+class MoleculeListClass;
 class periodentafel;
 class Tesselation;
@@ -37,4 +38,5 @@
 private:
 
+      MoleculeListClass *TestList;
       molecule *TestMolecule;
       element *hydrogen;
