Index: src/Filling/Predicates/IsCloseEnoughToSurface_FillPredicate.cpp
===================================================================
--- src/Filling/Predicates/IsCloseEnoughToSurface_FillPredicate.cpp	(revision df0c802c02abf1177a70b2bafe46af86cee53ad4)
+++ src/Filling/Predicates/IsCloseEnoughToSurface_FillPredicate.cpp	(revision df0c802c02abf1177a70b2bafe46af86cee53ad4)
@@ -0,0 +1,62 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * IsCloseEnoughToSurface_FillPredicate.cpp
+ *
+ *  Created on: Feb 16, 2016
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include <boost/bind.hpp>
+
+#include <functional>
+
+#include "IsCloseEnoughToSurface_FillPredicate.hpp"
+
+#include "AnyFillPredicate.hpp"
+#include "FillPredicate.hpp"
+#include "IsInsideSurface_FillPredicate.hpp"
+#include "Ops_FillPredicate.hpp"
+#include "Tesselation/tesselation.hpp"
+
+FillPredicate IsCloseEnoughToSurface_FillPredicate(
+		const Tesselation &_tess,
+		const LinkedCell_deprecated &_LC,
+		const double minimum_distance)
+{
+  AnyFillPredicate::FillPredicator function =
+		  boost::bind(std::greater_equal<double>(),
+				  boost::bind(&Tesselation::GetDistanceToSurface, boost::cref(_tess), _1, &_LC),
+  	  	  	  	  minimum_distance
+		  	 );
+  FillPredicate::impl_ptr impl(new AnyFillPredicate(function));
+  return !(FillPredicate(impl) && (!IsInsideSurface_FillPredicate(_tess, _LC)));
+}
Index: src/Filling/Predicates/IsCloseEnoughToSurface_FillPredicate.hpp
===================================================================
--- src/Filling/Predicates/IsCloseEnoughToSurface_FillPredicate.hpp	(revision df0c802c02abf1177a70b2bafe46af86cee53ad4)
+++ src/Filling/Predicates/IsCloseEnoughToSurface_FillPredicate.hpp	(revision df0c802c02abf1177a70b2bafe46af86cee53ad4)
@@ -0,0 +1,28 @@
+/*
+ * IsCloseEnoughToSurface_FillPredicate.hpp
+ *
+ *  Created on: Feb 16, 2016
+ *      Author: heber
+ */
+
+#ifndef ISCLOSEENOUGHTOSURFACE_FILLPREDICATE_HPP_
+#define ISCLOSEENOUGHTOSURFACE_FILLPREDICATE_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "FillPredicate.hpp"
+
+class LinkedCell_deprecated;
+class Tesselation;
+
+
+FillPredicate IsCloseEnoughToSurface_FillPredicate(
+		const Tesselation &_tess,
+		const LinkedCell_deprecated &_LC,
+		const double minimum_distance);
+
+#endif /* ISCLOSEENOUGHTOSURFACE_FILLPREDICATE_HPP_ */
Index: src/Filling/Predicates/IsInsideSurface_FillPredicate.cpp
===================================================================
--- src/Filling/Predicates/IsInsideSurface_FillPredicate.cpp	(revision 94d5ac60852caf3933c959f8314ca0be3d3a7c51)
+++ src/Filling/Predicates/IsInsideSurface_FillPredicate.cpp	(revision df0c802c02abf1177a70b2bafe46af86cee53ad4)
@@ -46,5 +46,6 @@
 FillPredicate IsInsideSurface_FillPredicate(const Tesselation &_tess, const LinkedCell_deprecated &_LC)
 {
-  AnyFillPredicate::FillPredicator function = boost::bind(&Tesselation::IsInnerPoint, &_tess, _1, &_LC);
+  AnyFillPredicate::FillPredicator function =
+		  boost::bind(&Tesselation::IsInnerPoint, boost::cref(_tess), _1, &_LC);
   FillPredicate::impl_ptr impl(new AnyFillPredicate(function));
   return FillPredicate(impl);
