code: func swapNodes(tree huffmanTree, path uint32, len uint32) {
  	for len > 0 {
  		// get current bit
  		len--
  		one := path & 1
  		path = path >> 1
  
  		// check if we are correct
  		if tree.IsLeaf() {
  			_panicf("Touching leaf in node swap, %d left in path", len)
  		}
  
  		// switch on the type
  		if one == 1 {
  			tree = tree.Right()
  		} else {
  			tree = tree.Left()
  		}
  	}
  
  	node := tree.(*huffmanNode)
  	node.left, node.right = node.right, node.left
  }
docs: // Swap two nodes based on the given path