private double findMin (Set<Double> set) {
        double min = Double.MAX_VALUE;
        for (double d : set) {
            if (d < min) {
                min = d;
            }
        }
        return min;
    }