Index: trunk/VUT/Ogre/include/OgreVisibilitySceneManager.h
===================================================================
--- trunk/VUT/Ogre/include/OgreVisibilitySceneManager.h	(revision 59)
+++ trunk/VUT/Ogre/include/OgreVisibilitySceneManager.h	(revision 87)
@@ -56,4 +56,5 @@
 	SceneNodeHierarchyInterface *mHierarchyInterface;
 	GtpVisibility::VisibilityManager *mVisibilityManager;
+	bool mUseCulling;
 };
 } // namespace Ogre
Index: trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h	(revision 74)
+++ trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h	(revision 87)
@@ -35,6 +35,5 @@
 	bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
 	bool HasGeometry(GtpVisibility::HierarchyNode *node) const;
-	bool HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 
-						    GtpVisibility::HierarchyNode *node2) const;
+	float GetSquaredDistance(GtpVisibility::HierarchyNode *node) const;
 	
 	void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible);
Index: trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h
===================================================================
--- trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h	(revision 78)
+++ trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h	(revision 87)
@@ -54,4 +54,5 @@
 	OctreeHierarchyInterface *mHierarchyInterface;
 	GtpVisibility::VisibilityManager *mVisibilityManager;
+	bool mUseCulling;
 };
 
Index: trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h	(revision 85)
+++ trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h	(revision 87)
@@ -25,6 +25,5 @@
 	void PullUpVisibility(GtpVisibility::HierarchyNode *node);
 	bool HasGeometry(GtpVisibility::HierarchyNode *node) const;
-	bool HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 
-						    GtpVisibility::HierarchyNode *node2) const;
+	float GetSquaredDistance(GtpVisibility::HierarchyNode *node) const;
 
 	void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible);
Index: trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h	(revision 74)
+++ trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h	(revision 87)
@@ -28,6 +28,5 @@
 	bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
 	bool HasGeometry(GtpVisibility::HierarchyNode *node) const;
-	bool HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 
-						    GtpVisibility::HierarchyNode *node2) const;
+	float GetSquaredDistance(GtpVisibility::HierarchyNode *node) const;
 	
 	void SetNodeVisible(GtpVisibility::HierarchyNode *node, const bool visible);
@@ -44,9 +43,5 @@
 	*/
 	AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node);
-	/** Returns squared distance of center of box with respect to the camera .
-		@param cam current camera
-		@param box axis aligned box
-	*/
-	Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const;
+	
 	unsigned int mNumOctreeNodes;
 };
Index: trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h
===================================================================
--- trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h	(revision 59)
+++ trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h	(revision 87)
@@ -57,4 +57,5 @@
 	OctreeHierarchyInterface *mHierarchyInterface;
 	GtpVisibility::VisibilityManager *mVisibilityManager;
+	bool mUseCulling;
 };
 
Index: trunk/VUT/Ogre/include/OgrePlatformOcclusionQuery.h
===================================================================
--- trunk/VUT/Ogre/include/OgrePlatformOcclusionQuery.h	(revision 86)
+++ trunk/VUT/Ogre/include/OgrePlatformOcclusionQuery.h	(revision 87)
@@ -22,6 +22,6 @@
 	virtual bool GetQueryResult(unsigned int &queryResult,
 		const bool waitForResult) const;
-	virtual void BeginQuery() const;
-	virtual void EndQuery() const;
+	virtual void BeginQuery();
+	virtual void EndQuery();
 
 protected:
Index: trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp	(revision 86)
+++ trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp	(revision 87)
@@ -16,15 +16,24 @@
 	mNumTraversedNodes ++;
 
+	Octree *octree = static_cast<Octree *>(node);
+
 	// if we come across some renderable geometry => render it
-	RenderNode(node);
+	if (octree->mNodes.size() > 0)
+	{
+		RenderNode(node);
+	}
 	
-	for(int i=0; i<8; ++i)
+	// if not all subtrees are empty
+	if (octree->numNodes() > (int)octree->mNodes.size())
 	{
-		Octree *nextChild = 
-			static_cast<Octree *>(node)->mChildren[(i & 4) >> 2][(i & 2) >> 1][i & 1];
+		for(int i=0; i<8; ++i)
+		{
+			Octree *nextChild = 
+				octree->mChildren[(i & 4) >> 2][(i & 2) >> 1][i & 1];
 
-        if (nextChild)
-		{
-			mDistanceQueue->push(nextChild);
+			if (nextChild)
+			{
+				mDistanceQueue->push(nextChild);
+			}
 		}
 	}
@@ -46,5 +55,5 @@
 bool OctreeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const
 {
-	return static_cast<Octree *>(node)->numNodes() > 0;
+	return static_cast<Octree *>(node)->mNodes.size() > 0;
 }
 //-----------------------------------------------------------------------
@@ -54,23 +63,10 @@
 }
 //-----------------------------------------------------------------------
-bool OctreeHierarchyInterface::HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 
-												  GtpVisibility::HierarchyNode *node2) const
+float OctreeHierarchyInterface::GetSquaredDistance(GtpVisibility::HierarchyNode *node) const
 {
-	return GetSquaredViewDepth(mCamera, &static_cast<Octree *>(node1)->mBox) > 
-		   GetSquaredViewDepth(mCamera, &static_cast<Octree *>(node2)->mBox);
-}
-//-----------------------------------------------------------------------
-Real OctreeHierarchyInterface::GetSquaredViewDepth(const Camera* cam, 
-												   const AxisAlignedBox* box) const
-{
+	AxisAlignedBox *box = &static_cast<Octree *>(node)->mBox;
 	Vector3 mid = ((box->getMinimum() - box->getMaximum()) * 0.5) + box->getMinimum();
-	// use nearest point rather than midpoint
-	Vector3 camPos = cam->getDerivedPosition();
 
-	Vector3 minPos(camPos.x < mid.x ? box->getMinimum().x : box->getMaximum().x,
-				   camPos.y < mid.y ? box->getMinimum().y : box->getMaximum().y,
-				   camPos.z < mid.z ? box->getMinimum().z : box->getMaximum().z);
-	
-	return (camPos - minPos).squaredLength();                                                                   
+	return (mCamera->getDerivedPosition() - mid).squaredLength();
 }
 //-----------------------------------------------------------------------
@@ -113,6 +109,4 @@
 		octant->setLastRendered(mFrameId);
 
-		if (!HasGeometry(octant)) return;
-
 		static_cast<OctreeSceneManager *>(mSceneManager)->_renderOctant(mCamera, octant);
 
Index: trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp	(revision 86)
+++ trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp	(revision 87)
@@ -12,12 +12,14 @@
 //-----------------------------------------------------------------------
 VisibilityOctreeSceneManager::VisibilityOctreeSceneManager(
-	GtpVisibility::VisibilityManager *visManager): mVisibilityManager(visManager)
+	GtpVisibility::VisibilityManager *visManager)
+: mVisibilityManager(visManager), mUseCulling(true)
 {
 	mHierarchyInterface = 
 		new OctreeHierarchyInterface(this, mDestRenderSystem);
-
+//	visManager->SetCullingManager(GtpVisibility::VisibilityEnvironment::STOP_AND_WAIT_CULLING);
 	//mDisplayNodes = true;
 	//mShowBoundingBoxes = true;
 	//mShowBoxes = true;
+
 	mMaxDepth = 20;
 }
@@ -30,4 +32,17 @@
 void VisibilityOctreeSceneManager::_renderVisibleObjects()
 {
+	mHierarchyInterface->InitFrame(mOctree, mCameraInProgress);
+	mVisibilityManager->GetCullingManager()->InitFrame();
+
+	if(!mUseCulling)
+	{	
+		OctreeSceneManager::_renderVisibleObjects();
+		return;
+	} 
+    
+	//-- hierarchical culling
+	// the objects of different layers (e.g., background, scene, 
+	// overlay) must be identified and rendered one after another
+
 	//-- render background
 	clearSpecialCaseRenderQueues();
@@ -36,5 +51,6 @@
 
 	setSpecialCaseRenderQueueMode(SceneManager::SCRQM_INCLUDE);
-	SceneManager::_renderVisibleObjects( );
+	SceneManager::_renderVisibleObjects();
+
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
 	_deleteRenderedQueueGroups();
@@ -46,5 +62,5 @@
 	setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE);
 
-	mHierarchyInterface->InitFrame(mOctree, mCameraInProgress);
+	//-- the hierarchical culling algorithm
 	mVisibilityManager->ApplyVisibilityCulling();
 
@@ -53,14 +69,18 @@
 #endif
 
-	//-- render rest, e.g., overlay
+	//-- render remaining objects, e.g., overlay
 	clearSpecialCaseRenderQueues();
 	SceneManager::_renderVisibleObjects();
-	//_deleteRenderedQueueGroups();
 }
 //-----------------------------------------------------------------------
 void VisibilityOctreeSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters)
 {
-	// must be empty because objects are found and rendered in an interleaved fashion
+	// empty if hierarchical culling is used =>
+	// we interleave identification and rendering of objects 
 	// in _renderVisibibleObjects 
+	if(!mUseCulling)
+	{
+		OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters);
+	}
 }
 //-----------------------------------------------------------------------
@@ -78,4 +98,10 @@
 bool VisibilityOctreeSceneManager::setOption(const String & key, const void * val)
 {
+	if (key == "UseCulling")
+	{
+		mUseCulling = (*static_cast<const bool *>(val));
+		return true;
+	}
+
 	return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface).
 		setOption(key, val) || OctreeSceneManager::setOption(key, val);
Index: trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp	(revision 85)
+++ trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp	(revision 87)
@@ -56,7 +56,5 @@
 bool SceneNodeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const
 {
-	SceneNode *sceneNode = static_cast<SceneNode *>(node);
-	
-	return sceneNode->numAttachedObjects() > 0;
+	return static_cast<SceneNode *>(node)->numAttachedObjects() > 0;
 }
 //-----------------------------------------------------------------------
@@ -74,11 +72,7 @@
 }
 //-----------------------------------------------------------------------
-bool SceneNodeHierarchyInterface::HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 
-													 GtpVisibility::HierarchyNode *node2) const
+float SceneNodeHierarchyInterface::GetSquaredDistance(GtpVisibility::HierarchyNode *node) const
 {
-	SceneNode *sceneNode1 = static_cast<SceneNode *>(node1);
-	SceneNode *sceneNode2 = static_cast<SceneNode *>(node2);
-
-	return sceneNode1->getSquaredViewDepth(mCamera) > sceneNode2->getSquaredViewDepth(mCamera);
+	return static_cast<SceneNode *>(node)->getSquaredViewDepth(mCamera);
 }
 //-----------------------------------------------------------------------
Index: trunk/VUT/Ogre/src/OgreBspHierarchyInterface.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreBspHierarchyInterface.cpp	(revision 74)
+++ trunk/VUT/Ogre/src/OgreBspHierarchyInterface.cpp	(revision 87)
@@ -26,12 +26,6 @@
 }
 //-----------------------------------------------------------------------
-bool BspHierarchyInterface::HasGreaterDistance(GtpVisibility::HierarchyNode *node1, 
-											   GtpVisibility::HierarchyNode *node2) const
+float BspHierarchyInterface::GetSquaredDistance(GtpVisibility::HierarchyNode *node) const
 {
-	return true;
-}
-//-----------------------------------------------------------------------
-Real BspHierarchyInterface::GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const
-{                                                            
 	return 0.0f;
 }
Index: trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp	(revision 86)
+++ trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp	(revision 87)
@@ -26,5 +26,5 @@
 void PlatformHierarchyInterface::DeleteQueries()
 {
-	for(unsigned int i=0; i < (unsigned int)mOcclusionQueries.size(); ++i)
+	for(int i=0; i < (int)mOcclusionQueries.size(); ++i)
 		delete mOcclusionQueries[i];
 
@@ -105,16 +105,15 @@
 	query->BeginQuery();
 			
-	// if leaf and was visible => will be rendered anyway, thus we
-	// can also test with the real geometry 
-	if(mUseOptimization && wasVisible && IsLeaf(node))
+	// if node is leaf and was visible => 
+	// will be rendered anyway.
+	// In this case we can also test with the real geometry.
+	/*if(mUseOptimization && wasVisible && IsLeaf(node))
 	{
-	//	OutputDebugString("Using optimization!!\n");
 		RenderNode(node);
 	}
 	else
-	{
-	//	OutputDebugString("Not optimized!!\n");
+	{*/
 		RenderBoundingBox(GetBoundingBox(node));
-	}
+	//}
 
 	query->EndQuery();
Index: trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp	(revision 86)
+++ trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp	(revision 87)
@@ -7,16 +7,16 @@
 #include <OgreCamera.h>
 
-//#include <windows.h>
+#include <windows.h>
 
 namespace Ogre {
-//namespace GtpVisibility {
+
 //-----------------------------------------------------------------------
 VisibilityTerrainSceneManager::VisibilityTerrainSceneManager(
-	GtpVisibility::VisibilityManager *visManager): mVisibilityManager(visManager)
+	GtpVisibility::VisibilityManager *visManager)
+: mVisibilityManager(visManager), mUseCulling(true)
 {
 	mHierarchyInterface = 
 		new OctreeHierarchyInterface(this, mDestRenderSystem);
 
-	//mShowBoxes = true;
 	//mDisplayNodes = true;
 	//mShowBoundingBoxes = true;
@@ -31,4 +31,17 @@
 void VisibilityTerrainSceneManager::_renderVisibleObjects()
 {
+	mHierarchyInterface->InitFrame(mOctree, mCameraInProgress);
+	mVisibilityManager->GetCullingManager()->InitFrame();
+
+	if(!mUseCulling)
+	{	
+		OctreeSceneManager::_renderVisibleObjects();
+		return;
+	} 
+	
+	//-- hierarchical culling
+	// the objects of different layers (e.g., background, scene, 
+	// overlay) must be identified and rendered one after another
+
 	//-- render background
 	clearSpecialCaseRenderQueues();
@@ -47,5 +60,5 @@
 	setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE);
 
-	mHierarchyInterface->InitFrame(mOctree, mCameraInProgress);
+	//-- the hierarchical culling algorithm
 	mVisibilityManager->ApplyVisibilityCulling();
 
@@ -56,11 +69,16 @@
 	//-- render overlay
 	clearSpecialCaseRenderQueues();
-	SceneManager::_renderVisibleObjects( );
+	SceneManager::_renderVisibleObjects();
 }
 //-----------------------------------------------------------------------
 void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters)
 {
-	// must be empty because objects are found and rendered in an interleaved fashion
+	// empty if hierarchical culling is used =>
+	// we interleave identification and rendering of objects 
 	// in _renderVisibibleObjects 
+	if(!mUseCulling)
+	{
+		OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters);
+	}
 }
 //-----------------------------------------------------------------------
@@ -79,4 +97,10 @@
 bool VisibilityTerrainSceneManager::setOption(const String & key, const void * val)
 {
+	if (key == "UseCulling")
+	{
+		mUseCulling = (*static_cast<const bool *>(val));
+		return true;
+	}
+
 	return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface).
 		setOption(key, val) || TerrainSceneManager::setOption(key, val);
@@ -115,4 +139,3 @@
 	return mVisibilityManager;
 }
-//} // namespace GtpVisibility
 } // namespace Ogre
Index: trunk/VUT/Ogre/src/OgrePlatformOcclusionQuery.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgrePlatformOcclusionQuery.cpp	(revision 86)
+++ trunk/VUT/Ogre/src/OgrePlatformOcclusionQuery.cpp	(revision 87)
@@ -14,10 +14,10 @@
 }
 //-----------------------------------------------------------------------
-void PlatformOcclusionQuery::BeginQuery() const
+void PlatformOcclusionQuery::BeginQuery()
 {
 	mHardwareOcclusionQuery->beginOcclusionQuery();
 }
 //-----------------------------------------------------------------------
-void PlatformOcclusionQuery::EndQuery() const
+void PlatformOcclusionQuery::EndQuery()
 {
 	mHardwareOcclusionQuery->endOcclusionQuery();
Index: trunk/VUT/Ogre/src/OgreVisibilityOptionsManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreVisibilityOptionsManager.cpp	(revision 86)
+++ trunk/VUT/Ogre/src/OgreVisibilityOptionsManager.cpp	(revision 87)
@@ -57,4 +57,10 @@
 		return true;
 	}
+	if (key == "NumQueriesIssued")
+	{
+		* static_cast<unsigned int *>(val) = 
+			mVisibilityManager->GetCullingManager()->GetNumQueriesIssued();
+		return true;
+	}
 	
 	return false;
Index: trunk/VUT/Ogre/src/OgreVisibilitySceneManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreVisibilitySceneManager.cpp	(revision 74)
+++ trunk/VUT/Ogre/src/OgreVisibilitySceneManager.cpp	(revision 87)
@@ -13,5 +13,5 @@
 //-----------------------------------------------------------------------
 VisibilitySceneManager::VisibilitySceneManager(GtpVisibility::VisibilityManager *visManager)
-:mVisibilityManager(visManager)
+:mVisibilityManager(visManager), mUseCulling(true)
 {
 	mHierarchyInterface = new SceneNodeHierarchyInterface(this, mDestRenderSystem);
@@ -25,10 +25,29 @@
 void VisibilitySceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters)
 {
-	// empty because we have to find objects in _renderVisibleObjects
+	// empty if hierarchical culling is used =>
+	// we interleave identification and rendering of objects 
+	// in _renderVisibibleObjects 
+	if(!mUseCulling)
+	{
+		SceneManager::_findVisibleObjects(cam, onlyShadowCasters);
+	}
 }
 //-----------------------------------------------------------------------
 void VisibilitySceneManager::_renderVisibleObjects()
 {
-		//-- render background
+	mHierarchyInterface->InitFrame(mSceneRoot, mCameraInProgress);
+	mVisibilityManager->GetCullingManager()->InitFrame();
+
+	if(!mUseCulling)
+	{	
+		SceneManager::_renderVisibleObjects();
+		return;
+	} 
+	
+	//-- hierarchical culling
+	// the objects of different layers (e.g., background, scene, 
+	// overlay) must be identified and rendered one after another
+
+	//-- render background
 	clearSpecialCaseRenderQueues();
 	addSpecialCaseRenderQueue(RENDER_QUEUE_BACKGROUND);
@@ -36,8 +55,9 @@
 
 	setSpecialCaseRenderQueueMode(SceneManager::SCRQM_INCLUDE);
-	SceneManager::_renderVisibleObjects( );
+	SceneManager::_renderVisibleObjects();
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
 	_deleteRenderedQueueGroups();
 #endif
+
 	//-- render visible objects (i.e., all but overlay)
 	clearSpecialCaseRenderQueues();
@@ -45,5 +65,5 @@
 	setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE);
 
-	mHierarchyInterface->InitFrame(mSceneRoot, mCameraInProgress);
+	//-- the hierarchical culling algorithm
 	mVisibilityManager->ApplyVisibilityCulling();
 
@@ -54,7 +74,5 @@
 	//-- render overlay
 	clearSpecialCaseRenderQueues();
-	SceneManager::_renderVisibleObjects( );
-
-	clearSpecialCaseRenderQueues();
+	SceneManager::_renderVisibleObjects();
 }
 //-----------------------------------------------------------------------
Index: trunk/VUT/Ogre/resources/VisibilityDemo.overlay
===================================================================
--- trunk/VUT/Ogre/resources/VisibilityDemo.overlay	(revision 86)
+++ trunk/VUT/Ogre/resources/VisibilityDemo.overlay	(revision 87)
@@ -9,5 +9,5 @@
 		left 5 
 		top 5
-		width 450
+		width 400
 		height 60
 		material Core/StatsBlockCenter
@@ -33,5 +33,5 @@
 			font_name TrebuchetMSBold
 			char_height 16
-			caption [A] Algorithm
+			caption [SPACE] Algorithm
 			colour_top 0.5 0.7 0.5
 			colour_bottom 0.3 0.5 0.3
@@ -110,8 +110,8 @@
 		vert_align top
 		horz_align right
-		left -355 
+		left -250 
 		top 5
-		width 450
-		height 105
+		width 320
+		height 120
 		material Core/StatsBlockCenter
         	border_size 1 1 1 1
@@ -256,5 +256,5 @@
 			colour_bottom 0.3 0.5 0.3
 		}
-		element TextArea(Example/Visibility/NumObjects)
+		element TextArea(Example/Visibility/Objects)
 		{
 			metrics_mode pixels
@@ -269,5 +269,5 @@
 			colour_bottom 0.3 0.5 0.3
 		}	
-		element TextArea(Example/Visibility/NumObjectsInfo)
+		element TextArea(Example/Visibility/ObjectsInfo)
 		{
 			metrics_mode pixels
@@ -282,6 +282,30 @@
 			colour_bottom 0.3 0.5 0.3
 		}
-
-
+		element TextArea(Example/Visibility/QueriesIssued)
+		{
+			metrics_mode pixels
+			left 5
+			top 95
+			width 180
+			height 30
+			font_name TrebuchetMSBold
+			char_height 16
+			caption Queries issued
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}	
+		element TextArea(Example/Visibility/QueriesIssuedInfo)
+		{
+			metrics_mode pixels
+			left 180
+			top 95
+			width 90
+			height 30
+			font_name TrebuchetMSBold
+			char_height 16
+			caption :
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}			
 	}
 }
