public void normalize() {
        double min = Double.MAX_VALUE;
        double max = Double.MIN_VALUE;
        for (Map.Entry<Double, Double> entry : knotMap.entrySet()) {
            double currVal = entry.getValue();
            if (currVal > max) {
                max = currVal;
            }
            if (currVal < min) {
                min = currVal;
            }
        }
        if ((min == 0 && max == 1) || min == max)
            return;

        double range = max - min;
        double shift = min;

        for (Map.Entry<Double, Double> entry : knotMap.entrySet()) {
            entry.setValue((entry.getValue() - shift) / range);
        }
    }