code: func (m *merkleTree) update(nextLeafLevelHash Hash) error {
  	logger.Debugf("Before update() = %s", m)
  	defer logger.Debugf("After update() = %s", m)
  	m.tree[leafLevel] = append(m.tree[leafLevel], nextLeafLevelHash)
  	currentLevel := leafLevel
  	for {
  		currentLevelHashes := m.tree[currentLevel]
  		if uint32(len(currentLevelHashes)) <= m.maxDegree {
  			return nil
  		}
  		nextLevelHash, err := computeCombinedHash(currentLevelHashes)
  		if err != nil {
  			return err
  		}
  		delete(m.tree, currentLevel)
  		nextLevel := currentLevel + 1
  		m.tree[nextLevel] = append(m.tree[nextLevel], nextLevelHash)
  		if nextLevel > m.maxLevel {
  			m.maxLevel = nextLevel
  		}
  		currentLevel = nextLevel
  	}
  }
docs: // update takes a hash that forms the next leaf level (level-1) node in the merkle tree.
  // Also, complete the merkle tree as much as possible with the addition of this new leaf node -
  // i.e. recursively build the higher level nodes and delete the underlying sub-tree.