 		}
 		
 		/**
-		 * tempBounds
 		 * Reusable temporary object, helps reduce garbage collection activity.
 		 */
 		private static const tempBounds:IBounds2D = new Bounds2D();
-
+
+		private static function sortOnImportance(v1:VertexChainLink, v2:VertexChainLink):int
+		{
+			var a:Number = v1.importance;
+			var b:Number = v2.importance;
+			
+			if (isNaN(a) && isNaN(b))
+				return 0;
+			
+			if (isNaN(a))
+				return 1;
+			
+			if (isNaN(b))
+				return -1;
+			
+			if (a < b)
+				return -1;
+			
+			if (a > b)
+				return 1;
+			
+			return 0;
+		}
+		
 		/**
-		 * processVertexChain
 		 * Sorts points by importance value, removes least important points first.
 		 * @param firstVertex The first vertex in a chain.
 		 * @param outputCoordinates The BLGTree to store the processed points in.

					sortArray[index] = vertex;
					vertex = vertex.next;
				}
				sortArray.sortOn("importance");
				
				// in sorted order, extract each point as long as its
				// surrounding points have not been invalidated


package weave.utils
{
	import mx.utils.ObjectUtil;
	
	import weave.api.primitives.IBounds2D;
	import weave.compiler.StandardLib;
	import weave.primitives.BLGTree;
	import weave.primitives.Bounds2D;
	import weave.primitives.VertexChainLink;
	
	/**
	 * This is an all-static class for building Binary Line Generalization Trees.
	 * 
	 * @author adufilie
