     return result
 }
 
+/// function returns a byte array in format [length_in_bytes] + [number of array items] + [bytes of CoderTreeValue array]
+/// this allows a decoder to set a capacity for an array of CoderTreeValue beign decoded from bytes
 private func countCapacityBytes(array: [CoderTreeValue]) -> [UInt8] {
     var stringMap = Dictionary<String, [UInt8]>(minimumCapacity: stringEntriesCount(array))
 
     return countCapacityBytes(array, stringMap: &stringMap)
 }
 
+/// function returns a byte array in format [length_in_bytes] + [number of array items] + [bytes of CoderTreeValue array]
+/// this allows a decoder to set a capacity for an array of CoderTreeValue beign decoded from bytes
+/// - note: stringMap dictionary is used to improve string encoding speed, see `String.writeToBuffer`
 private func countCapacityBytes(array: [CoderTreeValue], inout stringMap: [String: [UInt8]]) -> [UInt8] {
     var result = [UInt8]()
 

    static func readInt(inout bytes: [UInt8], inout offset: Int) -> Int? {
        guard bytes.count > offset + sizeof(Int) else { return nil }

        let bytesForCount: [UInt8] = Array(bytes[offset..<offset + sizeof(Int)])
        let value: Int = countValue(bytesForCount)

        offset += sizeof(Int)


    case IdentifyingTree(String,[CoderTreeValue])
}

/// Byte header to identify CoderTreeValue in a byte array
internal enum CerealCoderTreeValueType: UInt8 {
    case String = 1
    case Int = 2
