private void UpdateCountTable(Sequence target, float weight, Map<Integer, Float> CountTable, HashSet<Integer> hashSidVisited) {

		List<Integer> indexes = getMatchingSequences(target); 
		
		//creating an HashMap of the target's item (for O(1) search time)
		HashSet<Integer> hashTarget = new HashSet<Integer>();
		for(Item it : target.getItems()) {
			hashTarget.add(it.val);
		}
		
		
		//For each branch 
		for(Integer index : indexes) {

			if(hashSidVisited.contains(index)){
				continue;    
			}   
			
			//Getting the branch's leaf
			PredictionTree curNode = LT.get(index);
			
			//Transform this branch in a list
			List<Item> branch = new ArrayList<Item>();
			while(curNode.Parent != Root) {
				
				branch.add(curNode.Item);
				
				//Going up the tree
				curNode = curNode.Parent;
			}
			Collections.reverse(branch);
			
			HashSet<Integer> hashTargetTMP = new HashSet<Integer>(hashTarget);
			int i = 0;
			for(i = 0 ; i < branch.size() && hashTargetTMP.size() > 0; i++ ) {
				
				if(hashTargetTMP.contains(branch.get(i).val)== true) {
					hashTargetTMP.remove(branch.get(i).val);
				}	
			}
			
			for(;i < branch.size(); i++) {
				float oldValue = 0;
				if(CountTable.containsKey(branch.get(i).val)) {
					oldValue = CountTable.get(branch.get(i).val);
				}

				//Update the countable with the right weight and value
				float curValue = 1f /((float)indexes.size());
				CountTable.put(branch.get(i).val, oldValue + weight /((float)indexes.size()) );
				
				hashSidVisited.add(index); 
			}
		}
	}