Index: src/atom.cpp
===================================================================
--- src/atom.cpp	(revision 78b73c83586caecb47414ddf8f13f2e8d0da59b3)
+++ src/atom.cpp	(revision 89c8b25b009146faf28147259d014f97a6f3c327)
@@ -38,5 +38,5 @@
   previous = NULL;
   next = NULL;
-  father = this;  // generally, father is itself
+  father = pointer;  // generally, father is itself
   Ancestor = NULL;
   GraphNr = -1;
@@ -53,4 +53,5 @@
   nr = -1;
   sort = &nr;
+  node = &x;
 }
 
Index: src/molecules.cpp
===================================================================
--- src/molecules.cpp	(revision 78b73c83586caecb47414ddf8f13f2e8d0da59b3)
+++ src/molecules.cpp	(revision 89c8b25b009146faf28147259d014f97a6f3c327)
@@ -176,5 +176,5 @@
  * Increases molecule::last_atom and gives last number to added atom.
  * \param *pointer allocated and set atom
- * \return true - succeeded, false - atom not found in list
+ * \return pointer to the newly added atom
  */
 atom * molecule::AddCopyAtom(atom *pointer)
@@ -612,4 +612,28 @@
   return copy;
 };
+
+
+/**
+ * Copies all atoms of a molecule which are within the defined parallelepiped.
+ *
+ * @param offest for the origin of the parallelepiped
+ * @param three vectors forming the matrix that defines the shape of the parallelpiped
+ */
+molecule* molecule::CopyMoleculeFromSubRegion(Vector offset, double *parallelepiped) {
+  molecule *copy = new molecule(elemente);
+  atom *Walker = start;
+
+  while(Walker->next != end) {
+    Walker = Walker->next;
+    if (Walker->x.IsInParallelepiped(offset, parallelepiped)) {
+      cout << "Adding atom " << *Walker << endl;
+      copy->AddCopyAtom(Walker);
+    }
+  }
+
+  //TODO: copy->BuildInducedSubgraph((ofstream *)&cout, this);
+
+  return copy;
+}
 
 /** Adds a bond to a the molecule specified by two atoms, \a *first and \a *second.
Index: src/molecules.hpp
===================================================================
--- src/molecules.hpp	(revision 78b73c83586caecb47414ddf8f13f2e8d0da59b3)
+++ src/molecules.hpp	(revision 89c8b25b009146faf28147259d014f97a6f3c327)
@@ -207,4 +207,5 @@
 
   molecule *CopyMolecule();
+  molecule* CopyMoleculeFromSubRegion(Vector offset, double *parallelepiped);
 
   /// Fragment molecule by two different approaches:
Index: src/vector.cpp
===================================================================
--- src/vector.cpp	(revision 78b73c83586caecb47414ddf8f13f2e8d0da59b3)
+++ src/vector.cpp	(revision 89c8b25b009146faf28147259d014f97a6f3c327)
@@ -1221,2 +1221,23 @@
   return true;
 };
+
+/**
+ * Checks whether this vector is within the parallelepiped defined by the given three vectors and
+ * their offset.
+ *
+ * @param offest for the origin of the parallelepiped
+ * @param three vectors forming the matrix that defines the shape of the parallelpiped
+ */
+bool Vector::IsInParallelepiped(Vector offset, double *parallelepiped)
+{
+  Vector a;
+  a.CopyVector(this);
+  a.SubtractVector(&offset);
+  a.InverseMatrixMultiplication(parallelepiped);
+  bool isInside = true;
+
+  for (int i=NDIM;i--;)
+    isInside = isInside && ((a.x[i] <= 1) && (a.x[i] >= 0));
+
+  return isInside;
+}
Index: src/vector.hpp
===================================================================
--- src/vector.hpp	(revision 78b73c83586caecb47414ddf8f13f2e8d0da59b3)
+++ src/vector.hpp	(revision 89c8b25b009146faf28147259d014f97a6f3c327)
@@ -68,4 +68,5 @@
   void AskPosition(double *cell_size, bool check);
   bool Output(ofstream *out) const;
+  bool IsInParallelepiped(Vector offset, double *parallelepiped);
 };
 
Index: src/vectorunittest.cpp
===================================================================
--- src/vectorunittest.cpp	(revision 78b73c83586caecb47414ddf8f13f2e8d0da59b3)
+++ src/vectorunittest.cpp	(revision 89c8b25b009146faf28147259d014f97a6f3c327)
@@ -258,4 +258,36 @@
 }
 
+/**
+ * UnitTest for Vector::IsInParallelepiped().
+ */
+void VectorTest::IsInParallelepipedTest()
+{
+  double parallelepiped[NDIM*NDIM];
+  parallelepiped[0] = 1;
+  parallelepiped[1] = 0;
+  parallelepiped[2] = 0;
+  parallelepiped[3] = 0;
+  parallelepiped[4] = 1;
+  parallelepiped[5] = 0;
+  parallelepiped[6] = 0;
+  parallelepiped[7] = 0;
+  parallelepiped[8] = 1;
+
+  fixture.CopyVector(zero);
+  CPPUNIT_ASSERT_EQUAL( false, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
+  fixture.Init(2.5,2.5,2.5);
+  CPPUNIT_ASSERT_EQUAL( true, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
+  fixture.Init(1.,1.,1.);
+  CPPUNIT_ASSERT_EQUAL( false, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
+  fixture.Init(3.5,3.5,3.5);
+  CPPUNIT_ASSERT_EQUAL( false, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
+  fixture.Init(2.,2.,2.);
+  CPPUNIT_ASSERT_EQUAL( true, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
+  fixture.Init(2.,3.,2.);
+  CPPUNIT_ASSERT_EQUAL( true, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
+  fixture.Init(-2.,2.,-1.);
+  CPPUNIT_ASSERT_EQUAL( false, fixture.IsInParallelepiped(Vector(2.,2.,2.), parallelepiped) );
+}
+
 
 /********************************************** Main routine **************************************/
Index: src/vectorunittest.hpp
===================================================================
--- src/vectorunittest.hpp	(revision 78b73c83586caecb47414ddf8f13f2e8d0da59b3)
+++ src/vectorunittest.hpp	(revision 89c8b25b009146faf28147259d014f97a6f3c327)
@@ -28,4 +28,5 @@
     CPPUNIT_TEST ( LineIntersectionTest );
     CPPUNIT_TEST ( VectorRotationTest );
+    CPPUNIT_TEST ( IsInParallelepipedTest );
     CPPUNIT_TEST_SUITE_END();
 
@@ -44,4 +45,5 @@
     void LineIntersectionTest();
     void VectorRotationTest();
+    void IsInParallelepipedTest();
 
 private:
