def check_weights
      raise ArgumentError.new("Weights should be an odd list") unless @span.odd?
      sum = weights.inject(&:+)
      if sum < 0.999999 || sum > 1.000001
        raise ArgumentError.new("Weights must sum to 1")
      end
    end
def check_weights
      raise ArgumentError.new("Weights should be an odd list") unless @span.odd?
      sum = weights.inject(&:+)
      if sum < 0.999999 || sum > 1.000001
        raise ArgumentError.new("Weights must sum to 1")
      end
    end
Error checking for weights