Index: LinearAlgebra/src/LinearAlgebra/VectorSet.hpp
===================================================================
--- LinearAlgebra/src/LinearAlgebra/VectorSet.hpp	(revision 0cfc27793a722b1fdf1c500d9e92ac5c537731f2)
+++ LinearAlgebra/src/LinearAlgebra/VectorSet.hpp	(revision 31021ab41bc28ab43953c03d2923795a0813d773)
@@ -82,28 +82,11 @@
     if(!this->size())
       return zeroVec;
-    std::vector<Vector> helper;
-    helper.resize(this->size());
-    std::transform(this->begin(),this->end(),
-              helper.begin(),
-              std::bind2nd(std::mem_fun_ref(&Vector::operator-),point));
-    return *min_element(helper.begin(),helper.end(),
-        boost::lambda::_1 < boost::lambda::_2);
-        //(boost::lambda::bind(Vector::NormSquared,boost::lambda::_1) < boost::lambda::bind(Vector::NormSquared,boost::lambda::_2)));
-  }
-
-  /** Return the length of the Vector that is closest to \a point.
-   *
-   * @param point
-   * @return
-   */
-  double minDistSquared(const Vector &point){
-    if(!this->size())
-      return std::numeric_limits<double>::infinity();
-    std::vector<double> helper;
-    helper.resize(this->size());
-    std::transform(this->begin(),this->end(),
-              helper.begin(),
-              std::bind2nd(std::mem_fun_ref(&Vector::DistanceSquared),point));
-    return *min_element(helper.begin(),helper.end());
+    translate(-1.*point);
+//    std::transform(this->begin(),this->end(),
+//        this->begin(),
+//        std::bind2nd(std::mem_fun_ref(&Vector::operator-),point));
+    return *min_element(this->begin(),this->end(),
+//        boost::lambda::_1 < boost::lambda::_2);
+        (boost::lambda::bind(&Vector::NormSquared,boost::lambda::_1) < boost::lambda::bind(&Vector::NormSquared,boost::lambda::_2)));
   }
 };
Index: LinearAlgebra/src/unittests/VectorSetUnitTest.cpp
===================================================================
--- LinearAlgebra/src/unittests/VectorSetUnitTest.cpp	(revision 0cfc27793a722b1fdf1c500d9e92ac5c537731f2)
+++ LinearAlgebra/src/unittests/VectorSetUnitTest.cpp	(revision 31021ab41bc28ab43953c03d2923795a0813d773)
@@ -127,14 +127,23 @@
     Vector mindist = somelist.minDistance(center);
     CPPUNIT_ASSERT_EQUAL (Vector(1., 0., 0.), mindist);
+    // check that vector has changed (by nothing)
+    for (size_t i=0;i<somelist.size();++i)
+      CPPUNIT_ASSERT_EQUAL (Vector(i+1.,0.,0.), somelist[i]);
   }
   {
     Vector center(5.,0.,0.);
-    Vector mindist = worklist.minDistance(center);
+    VECTORSET(std::vector) somelist(worklist);
+    Vector mindist = somelist.minDistance(center);
     CPPUNIT_ASSERT_EQUAL (Vector(2., 1., 0.)-center, mindist);
+    // check that vector has changed
+    for (size_t i=0;i<somelist.size();++i)
+      CPPUNIT_ASSERT_EQUAL (somelist[i], worklist[i]-center);
   }
   {
     for (VECTORSET(std::vector)::const_iterator iter = worklist.begin();
         iter != worklist.end(); ++iter) {
-      Vector mindist = worklist.minDistance(*iter);
+      // copy list as we change it
+      VECTORSET(std::vector) somelist(worklist);
+      Vector mindist = somelist.minDistance(*iter);
       CPPUNIT_ASSERT_EQUAL( Vector(0.,0.,0.), mindist );
     }
@@ -142,21 +151,2 @@
 }
 
-/** UnitTest for minDistance()
- */
-void VectorSetTest::minDistSquaredTest()
-{
-  VECTORSET(std::vector) worklist(list);
-  {
-    Vector center(5.,0.,0.);
-    double mindist = worklist.minDistSquared(center);
-    double check = Vector(2., 1., 0.).DistanceSquared(center);
-    CPPUNIT_ASSERT_EQUAL( check, mindist );
-  }
-  {
-    for (VECTORSET(std::vector)::const_iterator iter = worklist.begin();
-        iter != worklist.end(); ++iter) {
-      double mindist = worklist.minDistSquared(*iter);
-      CPPUNIT_ASSERT_EQUAL( 0., mindist );
-    }
-  }
-}
Index: LinearAlgebra/src/unittests/VectorSetUnitTest.hpp
===================================================================
--- LinearAlgebra/src/unittests/VectorSetUnitTest.hpp	(revision 0cfc27793a722b1fdf1c500d9e92ac5c537731f2)
+++ LinearAlgebra/src/unittests/VectorSetUnitTest.hpp	(revision 31021ab41bc28ab43953c03d2923795a0813d773)
@@ -30,5 +30,4 @@
     CPPUNIT_TEST ( transformTest );
     CPPUNIT_TEST ( minDistanceTest );
-    CPPUNIT_TEST ( minDistSquaredTest );
     CPPUNIT_TEST_SUITE_END();
 
