public function accumulate($v) {
    $this->last_value = null;
    $key = $v->value[0];
    if(!isset($this->stream[$v->stream][$key])) {
      $this->stream[$v->stream][$key] = 0;
    }
    $this->stream[$v->stream][$key] += 1;
    
    if(isset($this->stream[$v->stream ^ 1][$key])) {
      $this->last_value = $v->value;
    }
  }