         var processed = 50
         var tables = [EncodingHuffmanTree]()
         var tablesLengths = [[Int]]()
-        var selectorsUsed = 0
         var selectors = [Int]()
 
         // Algorithm for code lengths calculations skips any symbol with frequency equal to 0.

        }

        bitWriter.write(number: tables.count, bitsCount: 3)
        bitWriter.write(number: selectorsUsed, bitsCount: 15)

        let mtfSelectors = mtf(selectors)
        for selector in mtfSelectors {
            guard selector <= 5
                else { fatalError("Incorrect selector.") }

    }

    private static func process(block data: Data, _ bitWriter: BitWriter) {
        var out: [Int]

        out = initialRle(data)

        var pointer = 0
        (out, pointer) = BurrowsWheeler.transform(bytes: out)

        let usedBytes = Set(out).sorted()
        out = mtf(out, characters: usedBytes)

        var maxSymbol = 0
        (out, maxSymbol) = rleOfMtf(out)

        // First, we analyze data and create Huffman trees and selectors.
        // Then we will perform encoding itself.
