code: func addNode(tree huffmanTree, path int, path_len int, value int) huffmanTree {
  	root := tree
  	for path_len > 1 {
  		if tree.IsLeaf() {
  			_panicf("Trying to add node to leaf")
  		}
  
  		// get the current bit
  		path_len--
  		one := path & 1
  		path = path >> 1
  
  		// add node / leaf
  		if one == 1 {
  			if tree.Right() != nil {
  				tree = tree.Right()
  			} else {
  				tree.(*huffmanNode).right = &huffmanNode{0, 0, nil, nil}
  				tree = tree.Right()
  			}
  		} else {
  			if tree.Left() != nil {
  				tree = tree.Left()
  			} else {
  				tree.(*huffmanNode).left = &huffmanNode{0, 0, nil, nil}
  				tree = tree.Left()
  			}
  		}
  	}
  
  	// set value
  	one := path & 1
  	path = path >> 1
  
  	if one == 1 {
  		tree.(*huffmanNode).right = huffmanLeaf{0, value}
  	} else {
  		tree.(*huffmanNode).left = huffmanLeaf{0, value}
  	}
  
  	return root
  }
docs: // Used to create a huffman tree by hand
  // path: Numeric representation of path to follow
  // value: Value for given path
  // value_default: Default value set for empty branches / leafs