Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h	(revision 710)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h	(revision 720)
@@ -57,5 +57,5 @@
 		/// the probability that this node contains view point
 		float mProbability;
-		/// geometry of node as induced by planes
+		/// geometry of node induced by half planes
 		BspNodeGeometry *mGeometry;
 		/// pvs size
@@ -63,8 +63,9 @@
 		/// how often this branch has missed the max-cost ratio
 		int mMaxCostMisses;
-		/// if this node is a kd-node (i.e., boundaries are axis aligned
+		/// if this node is a kd-node (i.e., boundaries are axis aligned)
 		bool mIsKdNode;
-		// hack for octree
+		/// current split axis: used for octree
 		int mAxis;
+		/// for priority traversal: priority of this traversal data
 		float mPriority;
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 719)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 720)
@@ -468,10 +468,12 @@
 	
 	// the current view cells are kept in this container
-	// we start with the current view cells from the
-	// view cell manager. They will change with
-	// subsequent merges
-	ViewCellContainer &activeViewCells = mViewCellsManager->GetViewCells();
-
-
+	// we start with the current view cells from the view cell manager. 
+	// The active view cells will change with subsequent merges
+	Debug << "here2" << endl; Debug.flush();
+	// todo: should rather take initial view cells
+    ViewCellContainer &activeViewCells = mViewCellsManager->GetViewCells();
+	//ViewCellContainer activeViewCells;
+	
+	Debug << "here2.6" << endl; Debug.flush();
 	ViewCell::NewMail();
 
@@ -487,5 +489,5 @@
 	// frequency stats are updated
 	const int statsOut = 500;
-
+	Debug << "here3" << endl; Debug.flush();
 	// passes are needed for statistics, because we don't want to record
 	// every merge
@@ -501,5 +503,5 @@
 	int maxMergesPerPass;
 	int numMergedViewCells = 0;
-
+	Debug << "here5" << endl; Debug.flush();
 	environment->GetIntValue("ViewCells.PostProcess.maxMergesPerPass", maxMergesPerPass);
 	environment->GetFloatValue("ViewCells.PostProcess.avgCostMaxDeviation", avgCostMaxDeviation);
@@ -537,7 +539,8 @@
 			const int numMergedViewCells = UpdateActiveViewCells(activeViewCells);
 		
-			// refines the view cells
-			// then priorities are recomputed
-			// and the candidates are put back into merge queue
+			
+			//-- resets / refines the view cells
+			//-- priorities are recomputed
+			//-- the candidates are put back into merge queue
 			if (mRefineViewCells)
 				RefineViewCells(rays, objects);
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 719)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 720)
@@ -279,5 +279,5 @@
 	float GetRendercost(ViewCell *viewCell, float objRendercost) const;
 
-	/** Returns container of loaded / generated view cells.
+	/** Returns reference to container of loaded / generated view cells.
 	*/
 	ViewCellContainer &GetViewCells();
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 719)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 720)
@@ -309,9 +309,6 @@
 	disposeRays(initialSamples, outRays);
 	
-	cout << "testing filter ... ";
-
-	TestFilter(preprocessor->mObjects);
-
-	cout << "finished" << endl;
+	// testing the view cell filter functionality	
+	if (0) TestFilter(preprocessor->mObjects);
 
 	// -- stats after contruction
@@ -359,6 +356,5 @@
 				 		Preprocessor::SPATIAL_BOX_BASED_DISTRIBUTION;*/
 
-		if (0)
-			dirSamples = !dirSamples; // toggle sampling method
+		if (0) dirSamples = !dirSamples; // toggle sampling method
 
 		numSamples += CastPassSamples(mSamplesPerPass, 
@@ -414,8 +410,8 @@
 		ComputeSampleContributions(postProcessSamples, true, storeViewCells);
 
-	// merge the view cells
+	//-- post processing (e.g.,merging) of the view cells
 	PostProcess(preprocessor->mObjects, postProcessSamples);
 
-	// only for testing
+	// only for debugging purpose
 	if (TEST_EMPTY_VIEW_CELLS)
 		CollectEmptyViewCells();
@@ -444,4 +440,6 @@
     //SetValidity(0, 99999999999);
 
+
+	// evaluation of the paritition, i.e., a number of new samples are cast
 	if (mEvaluateViewCells)
 	{
@@ -1136,5 +1134,5 @@
 void ViewCellsManager::UpdatePvs()
 {
-	if (mViewCellPvsIsUpdated)
+	if (mViewCellPvsIsUpdated || !ViewCellsTreeConstructed())
 		return;
 
@@ -1245,8 +1243,10 @@
 void ViewCellsManager::ResetViewCells()
 {
+	// recollect view cells
 	mViewCells.clear();
-	
 	CollectViewCells();
 	
+	
+	// stats are computed once more
 	mCurrentViewCellsStats.Reset();
 	EvaluateViewCellsStats();
@@ -3325,4 +3325,5 @@
 		maxPvs = mMaxPvsSize;
 	}
+
 	Debug << "setting validity, min: " << minPvs << " max: " << maxPvs << endl;
 	cout << "setting validity, min: " << minPvs << " max: " << maxPvs << endl;
@@ -3331,8 +3332,7 @@
 
 	// update valid view space according to valid view cells
-	if (0)
-		mVspBspTree->ValidateTree();
-
-	// has to be recomputed
+	if (0) mVspBspTree->ValidateTree();
+
+	// area has to be recomputed
 	mTotalAreaValid = false;
 	VssRayContainer postProcessRays;
@@ -3345,19 +3345,17 @@
 	// and to correct the rendering statistics
 	if (0) FinalizeViewCells(false);
-	
-	
+		
 	//-- merge the individual view cells
 	MergeViewCells(postProcessRays, objects);
 	
-	// only for testing
+
+	// only for debugging purpose: test if the subdivision is valid
 	TestSubdivision();
 
 	//-- refines the merged view cells
-	if (0)
-		RefineViewCells(postProcessRays, objects);
+	if (0) RefineViewCells(postProcessRays, objects);
 
 	
 	//-- render simulation after merge + refine
-	
 	cout << "\nevaluating bsp view cells render time before compress ... ";
 	dynamic_cast<RenderSimulator *>(mRenderer)->RenderScene();
@@ -3372,5 +3370,4 @@
 
 	//-- compression
-
 	if (ViewCellsTreeConstructed() && mCompressViewCells)
 	{
