                 repeatPower <<= 1
                 continue
             } else if repeat_ > 0 {
-                buffer.append(Array(repeating: favourites[0], count: repeat_), count: repeat_)
+                buffer.append(contentsOf: Array(repeating: favourites[0], count: repeat_))
                 repeat_ = 0
             }
             if symbol == symbolsInUse - 1 {

        var decoded = 0
        var repeat_ = 0
        var repeatPower = 0
        var buffer = Data()
        var t: HuffmanTable?

        while true {
            // TODO: WTF is going on with `decoded`?
            decoded -= 1
            if decoded <= 0 {
                decoded = 50

            }
        }

        func bwt(transform bytes: [UInt8]) -> [Int] {
            let sortedBytes = bytes.sorted()
            var base: [Int] = Array(repeating: -1, count: 256)
            for i in 0..<256 {
                base[i] = sortedBytes.index(of: UInt8(truncatingBitPattern: UInt(i))) ?? -1
            }

            var pointers: [Int] = Array(repeating: -1, count: bytes.count)
            for (i, char) in bytes.enumerated() {
                pointers[base[char.toInt()]] = i
                base[char.toInt()] += 1
