Index: molecuilder/src/linkedcell.cpp
===================================================================
--- molecuilder/src/linkedcell.cpp	(revision f7e18770c17f6023d1cfda39527f136d1c7ba415)
+++ molecuilder/src/linkedcell.cpp	(revision 41c00d5057ddad2dfd27dad0c2e8fa7c987c5c37)
@@ -337,4 +337,53 @@
 };
 
+/** Set the index to the cell containing a given Vector *x, which is not inside the LinkedCell's domain
+ * Note that as we have to check distance from every corner of the closest cell, this function is faw more
+ * expensive and if Vector is known to be inside LinkedCell's domain, then SetIndexToVector() should be used.
+ * \param *x Vector with coordinates
+ * \return minimum squared distance of cell to given vector (if inside of domain, distance is 0)
+ */
+double LinkedCell::SetClosestIndexToOutsideVector(const Vector * const x) const
+{
+  for (int i=0;i<NDIM;i++) {
+    n[i] = (int)floor((x->x[i] - min.x[i])/RADIUS);
+    if (n[i] < 0)
+      n[i] = 0;
+    if (n[i] >= N[i])
+      n[i] = N[i]-1;
+  }
+
+  // calculate distance of cell to vector
+  double distanceSquared = 0.;
+  bool outside = true;  // flag whether x is found in- or outside of LinkedCell's domain/closest cell
+  Vector corner; // current corner of closest cell
+  Vector tester; // Vector pointing from corner to center of closest cell
+  Vector Distance;  // Vector from corner of closest cell to x
+
+  Vector center;  // center of the closest cell
+  for (int i=0;i<NDIM;i++)
+    center.x[i] = min.x[i]+((double)n[i]+.5)*RADIUS;
+
+  int c[NDIM];
+  for (c[0]=0;c[0]<=1;c[0]++)
+    for (c[1]=0; c[1]<=1;c[1]++)
+      for (c[2]=0; c[2]<=1;c[2]++) {
+        // set up corner
+        for (int i=0;i<NDIM;i++)
+          corner.x[i] = min.x[i]+RADIUS*((double)n[i]+c[i]);
+        // set up distance vector
+        Distance.CopyVector(x);
+        Distance.SubtractVector(&corner);
+        const double dist = Distance.NormSquared();
+        // check whether distance is smaller
+        if (dist< distanceSquared)
+          distanceSquared = dist;
+        // check whether distance vector goes inside or outside
+        tester.CopyVector(&center);
+        tester.SubtractVector(&corner);
+        if (tester.ScalarProduct(&Distance) < 0)
+          outside = false;
+      }
+  return (outside ? distanceSquared : 0.);
+};
 
 /** Returns a list of all TesselPoint with distance less than \a radius to \a *Center.
@@ -351,11 +400,12 @@
 
   // set index of LC to center of sphere
-  if (!SetIndexToVector(center)) {
-    DoeLog(1) && (eLog()<< Verbose(1) << "Vector " << *center << " is outside of LinkedCell's bounding box." << endl);
+  const double dist = SetClosestIndexToOutsideVector(center);
+  if (dist > radius) {
+    DoeLog(1) && (eLog()<< Verbose(1) << "Vector " << *center << " is too far away from any atom in LinkedCell's bounding box." << endl);
     return TesselList;
   }
 
   // gather all neighbours first, then look who fulfills distance criteria
-  NeighbourList = GetallNeighbours(radius);
+  NeighbourList = GetallNeighbours(radius-dist);
   if (NeighbourList != NULL) {
     for (LinkedNodes::const_iterator Runner = NeighbourList->begin(); Runner != NeighbourList->end(); Runner++) {
Index: molecuilder/src/linkedcell.hpp
===================================================================
--- molecuilder/src/linkedcell.hpp	(revision f7e18770c17f6023d1cfda39527f136d1c7ba415)
+++ molecuilder/src/linkedcell.hpp	(revision 41c00d5057ddad2dfd27dad0c2e8fa7c987c5c37)
@@ -61,4 +61,5 @@
     bool SetIndexToNode(const TesselPoint * const Walker)const ;
     bool SetIndexToVector(const Vector * const x)const ;
+    double SetClosestIndexToOutsideVector(const Vector * const x) const;
     bool CheckBounds()const ;
     bool CheckBounds(const int relative[NDIM])const ;
@@ -67,5 +68,4 @@
     LinkedCell::LinkedNodes* GetallNeighbours(const double distance = 0) const;
     LinkedCell::LinkedNodes* GetPointsInsideSphere(const double radius, const Vector * const center) const;
-
     // not implemented yet
     bool AddNode(Vector *Walker);
