private void set(byte p, boolean intersectable, int k) {
    if(p < MIN_P) {
      throw new IllegalArgumentException("HLLCounter precisions cannot be less than MIN_P = " +
                                         Byte.toString(MIN_P));
    }
    if(p > MAX_P) {
      throw new IllegalArgumentException("HLLCounter precisions cannot be greater than MAX_P = " +
                                         Byte.toString(MAX_P));
    }
    if(intersectable && !(k > 0)) {
      throw new IllegalArgumentException("Intersectable HLLCounters must have a MinHash precision greater than 0.");
    }
    try {
      md = MessageDigest.getInstance("MD5");
    } catch(NoSuchAlgorithmException e) {
      throw new RuntimeException("Failed to instantiate hash algorithm.");
    }    
    this.p = p;
    m = (int)Math.pow(2, p);
    a = getAlpha(m);
    M = new byte[m];
    this.intersectable = intersectable;
    this.k = k;
    if(intersectable) {
      ts = new TreeSet<Long>();
    } else {
      this.k = 0;
    }
  }