update
diff --git a/CMakeFiles/Makefile.cmake b/CMakeFiles/Makefile.cmake
index 2cb619c..03d5392 100644
--- a/CMakeFiles/Makefile.cmake
+++ b/CMakeFiles/Makefile.cmake
@@ -17,31 +17,13 @@
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
   "/usr/local/share/pcl-1.7/PCLConfig.cmake"
   "/usr/local/share/pcl-1.7/PCLConfigVersion.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeCCompiler.cmake.in"
-  "/usr/share/cmake-2.8/Modules/CMakeCCompilerABI.c"
   "/usr/share/cmake-2.8/Modules/CMakeCInformation.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeCXXCompiler.cmake.in"
-  "/usr/share/cmake-2.8/Modules/CMakeCXXCompilerABI.cpp"
   "/usr/share/cmake-2.8/Modules/CMakeCXXInformation.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeClDeps.cmake"
   "/usr/share/cmake-2.8/Modules/CMakeCommonLanguageInclude.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeDetermineCompiler.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeDetermineCompilerABI.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeFindBinUtils.cmake"
   "/usr/share/cmake-2.8/Modules/CMakeGenericSystem.cmake"
   "/usr/share/cmake-2.8/Modules/CMakeImportBuildSettings.cmake"
   "/usr/share/cmake-2.8/Modules/CMakeParseArguments.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeParseImplicitLinkInfo.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeSystem.cmake.in"
   "/usr/share/cmake-2.8/Modules/CMakeSystemSpecificInformation.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeTestCompilerCommon.cmake"
-  "/usr/share/cmake-2.8/Modules/CMakeUnixFindMake.cmake"
   "/usr/share/cmake-2.8/Modules/Compiler/GNU-C.cmake"
   "/usr/share/cmake-2.8/Modules/Compiler/GNU-CXX.cmake"
   "/usr/share/cmake-2.8/Modules/Compiler/GNU.cmake"
@@ -50,7 +32,6 @@
   "/usr/share/cmake-2.8/Modules/FindPackageMessage.cmake"
   "/usr/share/cmake-2.8/Modules/FindPkgConfig.cmake"
   "/usr/share/cmake-2.8/Modules/FindVTK.cmake"
-  "/usr/share/cmake-2.8/Modules/Platform/Linux-CXX.cmake"
   "/usr/share/cmake-2.8/Modules/Platform/Linux-GNU-C.cmake"
   "/usr/share/cmake-2.8/Modules/Platform/Linux-GNU-CXX.cmake"
   "/usr/share/cmake-2.8/Modules/Platform/Linux-GNU.cmake"
diff --git a/CMakeFiles/pclBox.dir/pclBox.cpp.o b/CMakeFiles/pclBox.dir/pclBox.cpp.o
index 29443fc..6d2ad93 100644
--- a/CMakeFiles/pclBox.dir/pclBox.cpp.o
+++ b/CMakeFiles/pclBox.dir/pclBox.cpp.o
Binary files differ
diff --git a/pclBox b/pclBox
index 6cff4eb..2cd83f1 100755
--- a/pclBox
+++ b/pclBox
Binary files differ
diff --git a/pclBox.cpp b/pclBox.cpp
index ddcb2d9..4efc833 100644
--- a/pclBox.cpp
+++ b/pclBox.cpp
@@ -25,7 +25,7 @@
 // constants
 
 #define LINEPOINTSTEP       0.0001
-#define MAXDISTANCE         3.2f        // set workign distance
+#define MAXDISTANCE         1.4f        // set workign distance
 
 #define BACKGROUNDCAPTURE   100
 
@@ -492,6 +492,7 @@
     void subtracting (pcl::PointCloud<pcl::PointXYZ>::Ptr &in, pcl::PointCloud<pcl::PointXYZRGB>::Ptr &out){
 
         pcl::PointCloud<pcl::PointXYZ>::Ptr workCloud (new pcl::PointCloud<pcl::PointXYZ>);
+        pcl::PointCloud<pcl::PointXYZ>::Ptr workCloudDiff (new pcl::PointCloud<pcl::PointXYZ>);
         pcl::PointCloud<pcl::PointXYZ>::Ptr ransac_planeCloud (new pcl::PointCloud<pcl::PointXYZ>);
         pcl::PointCloud<pcl::PointXYZRGB>::Ptr planeCloudRGB (new pcl::PointCloud<pcl::PointXYZRGB>);
         pcl::PointCloud<pcl::PointXYZRGB>::Ptr workCloudRGB (new pcl::PointCloud<pcl::PointXYZRGB>);
@@ -533,9 +534,7 @@
                     workCloud->points.push_back(ransac_planeCloud->points[*pit]);
             }        
         
-            cout << "7" << std::endl;
             std::cout << "PointCloud representing the planar component: " << workCloud->size() << " data points." << std::endl;
-            cout << "7" << std::endl;
 
             if (workCloud->size() < 1000) {
                 break;
@@ -544,6 +543,13 @@
             copyCloud(workCloud, planeCloudRGB, rgb(rand() % 150 + 100, rand() % 150 + 100, rand() % 150 + 100));
             *out += *planeCloudRGB;
 
+            diffCloud(workCloud, in, workCloudDiff);
+            
+            copyCloud(workCloudDiff, in);
+            //copyCloud(workCloudDiff, planeCloudRGB, rgb(rand() % 150 + 100, rand() % 150 + 100, rand() % 150 + 100));
+            //*out += *planeCloudRGB;
+                    
+            //workCloudRGB;
 //            //
 //            boost::shared_ptr<std::vector<int> > newPointIdxVector(new std::vector<int>);
 //            pcl::octree::OctreePointCloudChangeDetector<pcl::PointXYZ> octree(0.001f);
@@ -570,7 +576,7 @@
 //            copyCloud(workCloud, in);
 
             
-        } while(false);
+        } while(true);
 
         std::cout << std::endl;
         
@@ -580,88 +586,88 @@
         return;        
     }
     
-    void mls (pcl::PointCloud<pcl::PointXYZ>::Ptr &in, pcl::PointCloud<pcl::PointNormal> &out) {
-          // Create a KD-Tree
-          pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ>);
-
-          // Init object (second point type is for the normals, even if unused)
-          pcl::MovingLeastSquares<pcl::PointXYZ, pcl::PointNormal> mls;
-
-          mls.setComputeNormals (true);
-
-          // Set parameters
-          mls.setInputCloud (in);
-          mls.setPolynomialFit (true);
-          mls.setSearchMethod (tree);
-          mls.setSearchRadius (0.03);
-
-          // Reconstruct
-          mls.process (out);
-    }
+//    void mls (pcl::PointCloud<pcl::PointXYZ>::Ptr &in, pcl::PointCloud<pcl::PointNormal> &out) {
+//          // Create a KD-Tree
+//          pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ>);
+//
+//          // Init object (second point type is for the normals, even if unused)
+//          pcl::MovingLeastSquares<pcl::PointXYZ, pcl::PointNormal> mls;
+//
+//          mls.setComputeNormals (true);
+//
+//          // Set parameters
+//          mls.setInputCloud (in);
+//          mls.setPolynomialFit (true);
+//          mls.setSearchMethod (tree);
+//          mls.setSearchRadius (0.03);
+//
+//          // Reconstruct
+//          mls.process (out);
+//    }
 
     // filters
 
-    void project_inliers(pcl::PointCloud<pcl::PointXYZ>::Ptr &in, pcl::PointCloud<pcl::PointXYZ>::Ptr &out) {
-        
-        pcl::ModelCoefficients::Ptr coefficients(new pcl::ModelCoefficients());
-        coefficients->values.resize(4);
-        coefficients->values[0] = 0;
-        coefficients->values[1] = 0;
-        coefficients->values[2] = 1.0;
-        coefficients->values[3] = 0;
+//    void project_inliers(pcl::PointCloud<pcl::PointXYZ>::Ptr &in, pcl::PointCloud<pcl::PointXYZ>::Ptr &out) {
+//        
+//        pcl::ModelCoefficients::Ptr coefficients(new pcl::ModelCoefficients());
+//        coefficients->values.resize(4);
+//        coefficients->values[0] = 0;
+//        coefficients->values[1] = 0;
+//        coefficients->values[2] = 1.0;
+//        coefficients->values[3] = 0;
+//
+//        // Create the filtering object
+//        pcl::ProjectInliers<pcl::PointXYZ> proj;
+//        proj.setModelType(pcl::SACMODEL_PLANE);
+//        proj.setInputCloud(in);
+//        proj.setModelCoefficients(coefficients);
+//        proj.filter(*out);
+//        
+//        return;
+//    }
 
-        // Create the filtering object
-        pcl::ProjectInliers<pcl::PointXYZ> proj;
-        proj.setModelType(pcl::SACMODEL_PLANE);
-        proj.setInputCloud(in);
-        proj.setModelCoefficients(coefficients);
-        proj.filter(*out);
-        
-        return;
-    }
-
-    void statistical_rutlier_removal(pcl::PointCloud<pcl::PointXYZ>::Ptr &in, pcl::PointCloud<pcl::PointXYZ>::Ptr &out) {
-        
-        pcl::StatisticalOutlierRemoval<pcl::PointXYZ> sor;
-        sor.setInputCloud (in);
-        sor.setMeanK (50);
-        sor.setStddevMulThresh (1.0);
-
-        //sor.setNegative (true);
-        sor.filter (*out);
-        
-        return;
-    }
+//    void statistical_rutlier_removal(pcl::PointCloud<pcl::PointXYZ>::Ptr &in, pcl::PointCloud<pcl::PointXYZ>::Ptr &out) {
+//        
+//        pcl::StatisticalOutlierRemoval<pcl::PointXYZ> sor;
+//        sor.setInputCloud (in);
+//        sor.setMeanK (50);
+//        sor.setStddevMulThresh (1.0);
+//
+//        //sor.setNegative (true);
+//        sor.filter (*out);
+//        
+//        return;
+//    }
       
-    void sample_consensus_model_plane(pcl::PointCloud<pcl::PointXYZ>::Ptr &in, pcl::PointCloud<pcl::PointXYZ>::Ptr &out) {
-        
-        std::vector<int> inliers;
-        pcl::SampleConsensusModelPlane<pcl::PointXYZ>::Ptr model_p (new pcl::SampleConsensusModelPlane<pcl::PointXYZ> (in));
-        
-        pcl::RandomSampleConsensus<pcl::PointXYZ> ransac (model_p);
-        ransac.setDistanceThreshold (.01);
-        ransac.computeModel();
-        ransac.getInliers(inliers);        
-        
-        pcl::copyPointCloud<pcl::PointXYZ>(*in, inliers, *out);
-        
-        return;        
-    }
+//    void sample_consensus_model_plane(pcl::PointCloud<pcl::PointXYZ>::Ptr &in, pcl::PointCloud<pcl::PointXYZ>::Ptr &out) {
+//        
+//        std::vector<int> inliers;
+//        pcl::SampleConsensusModelPlane<pcl::PointXYZ>::Ptr model_p (new pcl::SampleConsensusModelPlane<pcl::PointXYZ> (in));
+//        
+//        pcl::RandomSampleConsensus<pcl::PointXYZ> ransac (model_p);
+//        ransac.setDistanceThreshold (.01);
+//        ransac.computeModel();
+//        ransac.getInliers(inliers);        
+//        
+//        pcl::copyPointCloud<pcl::PointXYZ>(*in, inliers, *out);
+//        
+//        return;        
+//    }
     
-    void sample_consensus_model_sphere(pcl::PointCloud<pcl::PointXYZ>::Ptr &in, pcl::PointCloud<pcl::PointXYZ>::Ptr &out) {
-        
-        std::vector<int> inliers;
-        pcl::SampleConsensusModelSphere<pcl::PointXYZ>::Ptr model_s (new pcl::SampleConsensusModelSphere<pcl::PointXYZ> (in));
-        
-        pcl::RandomSampleConsensus<pcl::PointXYZ> ransac (model_s);
-        ransac.setDistanceThreshold (1.0);
-        ransac.computeModel();
-        ransac.getInliers(inliers);        
-        
-         pcl::copyPointCloud<pcl::PointXYZ>(*in, inliers, *out);
-        
-        return;        
-    }
+//    void sample_consensus_model_sphere(pcl::PointCloud<pcl::PointXYZ>::Ptr &in, pcl::PointCloud<pcl::PointXYZ>::Ptr &out) {
+//        
+//        std::vector<int> inliers;
+//        pcl::SampleConsensusModelSphere<pcl::PointXYZ>::Ptr model_s (new pcl::SampleConsensusModelSphere<pcl::PointXYZ> (in));
+//        
+//        pcl::RandomSampleConsensus<pcl::PointXYZ> ransac (model_s);
+//        ransac.setDistanceThreshold (1.0);
+//        ransac.computeModel();
+//        ransac.getInliers(inliers);        
+//        
+//         pcl::copyPointCloud<pcl::PointXYZ>(*in, inliers, *out);
+//        
+//        return;        
+//    }
     
     
 public:
@@ -692,8 +698,8 @@
         pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_near (new pcl::PointCloud<pcl::PointXYZ>);
         pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud_visual (new pcl::PointCloud<pcl::PointXYZRGB>);
         
-        copyCloud(raw_cloud, cloud_near);
-        //copyCloud(raw_cloud, cloud_near, MAXDISTANCE);
+        //copyCloud(raw_cloud, cloud_near);
+        copyCloud(raw_cloud, cloud_near, MAXDISTANCE);
 
         if (background_capture > 0) {