for (int i = 0; i < paths.size(); i++) {
            if (p == paths.get(i)) {
                j = i;
            }
        }