protected void trace(nodeList[] n) {
        // this loop allows the algorithm to show the path taken on the canvas
        for (int i = 0; i < n.length; i++) {
            nodeList currentNode = n[i];
            if (n[i] != null) {
                currentNode.node.setColour(getUsed());
                if (currentNode.precedentID != -1) {
                    for (int j = n.length - 1; j >= 0; j--) {
                        if (n[j] != null) {
                            nodeList pred = n[j];
                            if (pred.ID == currentNode.precedentID) {
                                // ok now we should have the end node we need to find the edge between them
                                Iterator<Edge> eIter = currentNode.node.getEdges().iterator();
                                while (eIter.hasNext()) {
                                    Edge e = eIter.next();
                                    GraphNode end = e.getAdjoiningNode(currentNode.node);
                                    if (end.equals(pred.node)) {
                                        // the above should find an edge from i (current) to j (pred)
                                        e.setColour(getUsed());
                                        update(getGraphic());
                                        //pause();
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        //rootNode.setColour(start_n);
        update(getGraphic());
    }