public static <TYPE> void shortestPath(TYPE neuron, TYPE endNeuron, Graph graph, Map infoMap, Set visitedNeurons){
		//add to visited so we wont check it again
		visitedNeurons.add(neuron);
		DataHolder<TYPE> neuronData  = (DataHolder<TYPE>)infoMap.get(neuron);
		//find all it edges
		List<Edge> list = graph.getEdgesFrom(neuron);
		for (int i = 0; i <list.size() ; i++) {
			Edge e = list.get(i);
			//the node pointing outward
			TYPE resolve = (TYPE) e.getDestination();
			if (e.getDestination().equals(neuron)) {
				resolve = (TYPE) e.getStart();
			}
			//get the neughbour data
		    DataHolder<TYPE> data  = (DataHolder<TYPE>)infoMap.get(resolve);
			//add the neuron we are to the current edge weight
			int compareValue = neuronData.getWeight()+e.getWeight();
			//if its less then the weight set on the neighbour, change it
                if( compareValue < data.getWeight()){
                    data.setCameFrom(neuron);
                    data.setWeight(compareValue);
                    //put the newly freshed into the infomap replacing the old
                    infoMap.put(resolve,data);
                }

        }

		int lowestWeight = Integer.MAX_VALUE;
		Iterator it = infoMap.entrySet().iterator();
		TYPE nextTo = null;
		DataHolder<TYPE> nextData  = null;
		HashMap<TYPE,DataHolder<TYPE>> temp = new HashMap<>();
		while (it.hasNext()) {
			Map.Entry pairs = (Map.Entry)it.next();
			DataHolder<TYPE> thisData = (DataHolder<TYPE>)pairs.getValue();
			//try next one if it has weight set
			if(thisData.getWeight()<lowestWeight){
				if(!thisData.isHasWeightSet()){
					nextData = thisData;
					lowestWeight = thisData.getWeight();
					nextTo = (TYPE)pairs.getKey();
				}
			}
		}
		if(nextData != null)
			nextData.setHasWeightSet(true);
		DataHolder<TYPE> endData = (DataHolder<TYPE>) infoMap.get(endNeuron);
		if(endData.isHasWeightSet()&& visitedNeurons.contains(endNeuron)){
			return;
        }
		shortestPath(nextTo,endNeuron,graph,infoMap,visitedNeurons);
	}