public Node inDistNodeList(String word, double distance,int direction){
		Double dist = new Double(distance);
		Node flagNode = new Node("NULL",0,0);
		if(direction == DFSSearch.LEFT){
			if(LeftDistNodeList.containsKey(dist)) {
				ArrayList<Node> tempList = LeftDistNodeList.get(dist);
				int length = tempList.size();
				for(int i=0 ; i<length;i++) {
					Node temp = tempList.get(i);
					// increase frequency if node is found
					if(temp.getLabel().equals(word)){
						double freq;

						freq = temp.getcount() + 1;
						temp.setcount(freq);

						flagNode = temp;
					}
				}
			}
		}
		if(direction == DFSSearch.RIGHT){
			if(RightDistNodeList.containsKey(dist)) {
				ArrayList<Node> tempList = RightDistNodeList.get(dist);
				int length = tempList.size();
				for(int i=0 ; i<length;i++) {
					Node temp = tempList.get(i);
					if(temp.getLabel().equals(word)){
						double freq;

						freq = temp.getcount() + 1;
						temp.setcount(freq);

					}
				}
			}
		}
		return flagNode;
	}