 				var prevPrevGridTest:uint = 0;
 				var prevGridTest:uint = 0;
 				var gridTest:uint;
-				var sameOutsideGridID:Boolean = false; // true when the two previous consecutive points were in the same off-screen grid
 				var stackPos:int = 0;
 				var node:BLGNode;
 				var operation:int;

				else // newNode should go to the right of currentNode
				{
					if (newNode.index > rightTraversalNode.index) // will only happen once, when rightTraversalNode == currentNode
					{
						if (rightTraversalNode != currentNode)
							throw new Error("Unexpected error. rightTraversalNode != currentNode");
						
						if (rightTraversalNode.right != null)
						{

				if (newNode.index < currentNode.index) // newNode should go to the left of currentNode
				{
					if (newNode.index < leftTraversalNode.index) // will only happen once, when leftTraversalNode == currentNode
					{
						/*
						// for debugging
						if (leftTraversalNode != currentNode)
							throw new Error("Unexpected error. leftTraversalNode != currentNode");
						*/
						
						if (leftTraversalNode.left != null)
						{
