 			return into;
 		}
 		
-		/** @private Updates the add/remove lists at the end of the frame. */
-		internal function updateLists():void
+		/**
+		 * Updates the add/remove lists at the end of the frame.
+		 */
+		public function updateLists():void
 		{
 			var e:Entity;
 			

			if (e._typePrev) e._typePrev._typeNext = e._typeNext;
			e._typeNext = e._typePrev = null;
			_typeCount[e._type] --;
		}
		
		/** @private Removes all nulls from the array. */
		private static function removeNulls(a:Array):void
		{
			var i:int = 0,
				j:int = a.length;
			if (j == 1 && a[0] == null)
			{
				a.length = 0;
				return;
			}
			while (i < j)
			{
				while (a[i] != null) i ++;
				while (a[j] == null) j --;
				a[i] = a[j];
				a[j] = null;
			}
			a[j] = a[i];
			a[i] = null;
			a.length -= a.length - a.indexOf(null);
		}
		
		/** @private Quicksorts the values in the array. */
		private static function sort(a:Array, left:int, right:int):void
		{
			var i:int = left,
				j:int = right,
				p:int = a[Math.round((left + right) * .5)],
				t:int;
			while (i <= j)
			{
				while (a[i] < p) i ++;
				while (a[j] > p) j --;
				if (i <= j)
				{
					t = a[i];
					a[i ++] = a[j];
					a[j --] = t;
				}
			}
			if (left < j) sort(a, left, j);
			if (i < right) sort(a, i, right);
			return;
		}
		
		/** @private Calculates the squared distance between two rectangles. */

			var f:Entity = _renderFirst[e._layer];
			if (f)
			{
				// Append entity to existing layer.
				e._renderNext = f;
				f._renderPrev = e;
				_layerCount[e._layer] ++;
			}
			else
			{
				// Create new layer with entity.
				_renderLast[e._layer] = e;
				_layerList[_layerList.length] = e._layer;
				_layerSort = true;
