public ArrayList<Point> abstractSearch(ArrayList<Point> visited, 
            int size, boolean frontOrBack) {
        // Get the most recently searched node in the visited list
        Point head = visited.get(visited.size() - 1);
        // If we haven't reached end of graph, continue searching
        if (!(this.posnEquals(head, new Point(size, size)))) {
            // Add all edges that contain neighbors of the head to toDo
            this.addAllNeighbors(head);
            // Get the Edge at the either the front or back of toDo list
            Edge firstEdge = this.toDo.get(this.getIndex(frontOrBack));
            // Add the new Posn from firstEdge to the visited list
            visited.add(firstEdge.getPosn(visited));
            // Remove firstEdge from the tree and toDo
            this.tree.remove(firstEdge);
            this.toDo.remove(firstEdge);
            return visited;
        } 
        else {
            return visited;
        }
    }