public static Box rePack(Box root, double tolerance) {
        LinkedList<Box> batch = new LinkedList<>();

        root.collectBestBoxes(batch, tolerance);

        Collections.sort(batch, (b1, b2) -> Double.compare(b2.v.volume(), b1.v.volume()));

        LinkedList<Box> next = new LinkedList<>();

        // skip the largest element
        next.add(batch.poll());

        // combine next-largest element with random (smaller) element
        while (batch.size() > 1) {
            Box b1 = batch.poll();

            int i = rnd.nextInt(batch.size());
            Box b2 = batch.get(i);

            next.add(stackedCombo(batch, b1, b2));
        }

        // add rest of batch
        next.addAll(batch);

        // take a new round of packing
        return pack(next);
    }