 			var xDistance:Number;
 			var yDistance:Number;
 			var distanceSq:Number;
-			var recordBounds:IBounds2D;
 			var xQueryCenter:Number = queryBounds.getXCenter();
 			var yQueryCenter:Number = queryBounds.getYCenter();
 			var foundQueryCenterOverlap:Boolean = false; // true when we found a key that overlaps the center of the given bounds

		private const maxKDKey:Array = [NaN, NaN, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY];
		
		// provides a reverse lookup for probe()
		private var objectToBounds:Dictionary = new Dictionary(true);
		
		/**
		 * Removes all entries from the index.

				var object:Object = selectedObjects[i];
				var overlapsQueryCenter:Boolean = false;
				
				// get the bounds associated with the selected object
				_tempBounds.setBounds.apply(null, objectToCoords[object] as Array);
				
				// find the distance squared from the query center point to the center of the object's bounds
				xDistance = _tempBounds.getXCenter() - xQueryCenter;
				yDistance = _tempBounds.getYCenter() - yQueryCenter;
				distanceSq = xDistance * xDistance + yDistance * yDistance;
				
				overlapsQueryCenter = _tempBounds.contains(xQueryCenter, yQueryCenter);
				
				// Consider all keys until we have found one that overlaps the query center.
				// After that, only consider keys that overlap query center.
				if (!foundQueryCenterOverlap || overlapsQueryCenter)
				{
					// if this is the first record that overlaps the query center, reset the result
					if (!foundQueryCenterOverlap && overlapsQueryCenter)
					{
						foundQueryCenterOverlap = true;
						resultCount = 0;
						closestDistanceSq = Infinity;
					}
					// if this distance is closer than any previous distance, clear all previous keys
					if (distanceSq < closestDistanceSq)
					{
						// clear previous result and update closest distance
						resultCount = 0;
						closestDistanceSq = distanceSq;
					}
					// add keys to the result if they are the closest so far
					if (distanceSq == closestDistanceSq && (resultCount == 0 || result[resultCount - 1] != object))
						result[resultCount++] = object;
				}
			}
			
			result.length = resultCount;
			return result;
		}
		
		public static function test():void
		{
			var a:Bounds2D = new Bounds2D(69, 110, 121, 129);
			var b:Bounds2D = new Bounds2D(92, 120, 117, 139);
			var i:Bounds2DIndex = new Bounds2DIndex();
			i.insert(a, 'a');
			i.insert(b, 'b');
			var p:Bounds2D = new Bounds2D(108, 120, 110, 122);
			trace(i.probe(p)); // returns b because b's center is closest to the query bounds center
		}
	}
}
