                             }
                         }
 
-                        self.newTree[treeIndex] = .branch(replacementArray)
+                        self.tree[treeIndex] = .branch(replacementArray)
                     }
                 default:
                     continue

            case .branch(_):
                let leftChildIndex = 2 * index + 1
                if leftChildIndex < self.leafCount {
                    switch self.newTree[leftChildIndex] {
                    case .leaf(let foundLeftSymbol):
                        if foundLeftSymbol == symbol {
                            index = leftChildIndex

        var index = 0
        var bits = [UInt8]()
        while true {
            switch self.tree[index] {
            case .leaf(let foundSymbol):
                if foundSymbol == symbol {
                    return bits
