public SuffixTreeNode traceToNode(String str){
		SuffixTreeNode current = this.root;
		int pointer = 0;
		while(pointer<str.length()){
			SuffixTreeNode next = this.searchEndChild(current, str.charAt(pointer));
			if(next!=null){
				current = next;
				int matchPtr = current.cut;
				while(matchPtr<=current.end){
					if(current.stringRepr.charAt(matchPtr++-current.start)!=str.charAt(pointer++)){
						return null;
					}
					if(pointer>=str.length()){
						return current;
					}
				}
			}else{
				return null;
			}
		}
		throw new IllegalStateException();
	}