public void update(int pos, int keyweights,  List lengthDist, PriorityQueue q) throws IllegalArgumentException {
	
		ArrayList EtSedges = (ArrayList) EtS.get(keyweights);
		Iterator k = EtSedges.iterator();
	
		if(!k.hasNext()){
			return;
		}
		
		WeightedEdge we = (WeightedEdge) k.next();
		int i = we.getSource();
		int j = we.getTarget();
		if(colors[j] != 2){
			int ft = distances[i] + keyweights;
			//q.updateKeyTo(items[pos] , ft);
			q.insert(keyweights, ft);
			return;
		}
		
	
		while(colors[j]==2){
		//	k.remove(we);
			k.remove();
			if(k.hasNext()){
				we = (WeightedEdge)k.next();
				j = we.getTarget();
			}else{
				break;
			}
			
		}
		
		if(colors[j] != 2){
			i = we.getSource();
			int ft = distances[i] + keyweights;
			q.insert(keyweights, ft);
		}
	}