             else { throw LZMA2Error.WrongSizes }
     }
 
+    // MARK: Main LZMA decoder function.
+
     func decodeLZMA(_ uncompressedSize: inout Int) throws {
         // First, we need to initialize Rande Decoder.
         guard let rD = LZMARangeDecoder(&self.pointerData) else {

        self.lenDecoder = LZMALenDecoder(&self.pointerData)
        self.repLenDecoder = LZMALenDecoder(&self.pointerData)
    }

    private func resetProperties() throws {
        var properties = pointerData.alignedByte()

            len += LZMAConstants.matchMinLen
            if uncompressedSize > -1 && uncompressedSize < len { throw LZMAError.RepeatWillExceed }
            for _ in 0..<len {
                let byte = self.byte(at: rep0 + 1)
                uncompressedSize -= 1
                self.put(byte)
            }
        }
    }

    // MARK: Dictionary (out window) related functions.

    private func put(_ byte: UInt8) {
        out.append(byte)
        dictEnd += 1
        if dictEnd - dictStart == dictionarySize {
            dictStart += 1
        }
    }

    private func byte(at distance: Int) -> UInt8 {
        return out[distance <= dictEnd ? dictEnd - distance : dictionarySize - distance + dictEnd]
    }

}
