private Node traceSingleEdge( Node node, Path str, TraceReturnValue trv, 
		SkipType type )   
	{
	   Node contNode;
	   int length,strLen;

	   // set default return values
	   trv.searchDone = true;
	   trv.edgePos    = 0;

	   // search for the first character of the string in the outgoing 
	   // edge of node 
	   contNode = findSon( node, treeString[str.begin] );
	   if ( contNode == null )
	   {
	      // Search is done, string not found
	      trv.edgePos = getNodeLabelLength( node )-1;
	      trv.charsFound = 0;
	      return node;
	   }
	   // found first character - prepare for continuing the search
	   node    = contNode;
	   length  = getNodeLabelLength( node );
	   strLen = str.end - str.begin + 1;

	   // compare edge length and string length. 
	   // if edge is shorter then the string being searched and skipping 
	   // is enabled - skip edge 
	   if ( type == SkipType.skip )
	   {
	      if ( length <= strLen )
	      {
	         trv.charsFound = length;
	         trv.edgePos = length-1;
	         if ( length < strLen )
	            trv.searchDone  = false;
	      }
	      else
	      {
	         trv.charsFound = strLen;
	         trv.edgePos = strLen-1;
	      }
	      return node;
	   }
	   else
	   {
	      // find minimum out of edge length and string length, and scan it
	      if ( strLen < length)
	         length = strLen;

	      for ( trv.edgePos=1, trv.charsFound=1; trv.edgePos<length; 
	      	trv.charsFound++,trv.edgePos++ )
	      {
	         // compare current characters of the string and the edge. 
	    	 // if equal - continue
	         if ( treeString[node.edgeLabelStart+trv.edgePos] != 
	        	 treeString[str.begin+trv.edgePos])
	         {
	            trv.edgePos--;
	            return node;
	         }
	      }
	   }
	   // the loop has advanced edgePos one too much 
	   trv.edgePos--;
	   if ( (trv.charsFound) < strLen )
	      // search is not done yet
	      trv.searchDone = false;
	   return node;
	}