public boolean removeDeadEnds() {
        boolean removed = false;
        for (int i=0; i< Canvas.coordListSize;i++) {
            if (adj[i].size() == 1) {
                removed = true;
                adj[i].pop();
                for (int j=0; j<Canvas.coordListSize; j++) {
                    if (adj[j].contains(i)) {
                        adj[j].remove(Integer.valueOf(i));
                    }
                }
            }
        }
        return removed;
    }