    arrays = @arrays = []
    allViews = []
    sum = []
-   @length = 0
+   length = @length = 0
    @struct = struct
-
-   if capacity?
-    @length = capacity
-    n = capacity
+   size = 0
+
+   if start_size?
+    length = @length = start_size
+    n = start_size
     size = INT_SIZE
+    while size isnt MAX_SIZE and n > size
+     size = size << 1
+
     ls = 0
     while true
      lastArr = TDS.Array struct, size
+     capacity += size
      lastViews = lastArr.views
      arrays.push lastArr
      allViews.push lastViews

   findRes[1] = p - sum[bs_l-1]
  return

 find_inline = (p) ->
  if p < 16
   findRes[0] = 0
   findRes[1] = p - 0
   return
  if p < 48
   findRes[0] = 1
   findRes[1] = p - 16
   return
  if p < 112
   findRes[0] = 2
   findRes[1] = p - 48
   return
  if p < 240
   findRes[0] = 3
   findRes[1] = p - 112
   return
  if p < 496
   findRes[0] = 4
   findRes[1] = p - 240
   return
  if p < 1008
   findRes[0] = 5
   findRes[1] = p - 496
   return
  if p < 2032
   findRes[0] = 6
   findRes[1] = p - 1008
   return
  if p < 4080
   findRes[0] = 7
   findRes[1] = p - 2032
   return
  if p < 8176
   findRes[0] = 8
   findRes[1] = p - 4080
   return
  if p < 16368
   findRes[0] = 9
   findRes[1] = p - 8176
   return
  if p < 32752
   findRes[0] = 10
   findRes[1] = p - 16368
   return
  if p < 65520
   findRes[0] = 11
   findRes[1] = p - 32752
   return
  if p < 131056
   findRes[0] = 12
   findRes[1] = p - 65520
   return
  if p < 262128
   findRes[0] = 13
   findRes[1] = p - 131056
   return
  if p < 524272
   findRes[0] = 14
   findRes[1] = p - 262128
   return
  if p < 1048560
   findRes[0] = 15
   findRes[1] = p - 524272
   return
  if p < 2097136
   findRes[0] = 16
   findRes[1] = p - 1048560
   return
  if p < 4194288
   findRes[0] = 17
   findRes[1] = p - 2097136
   return
  if p < 8388592
   findRes[0] = 18
   findRes[1] = p - 4194288
   return
  if p < 16777200
   findRes[0] = 19
   findRes[1] = p - 8388592
   return
  if p < 33554416
   findRes[0] = 20
   findRes[1] = p - 16777200
   return
  return

 #find = find_inline
 ###
 # inline find is faster for small number of arrays
 # binar search should be used after
 # In this case since the inline code is fast since it go no
 # loops. So I hope 20 is a good number
 ###
 #
 find = (p) ->
  if p < 33554416 #sum at the 20th index
   find_inline p
  else
   find_binary_search p

 GetArrayListIterator = (i_arr, i_pos) ->
  arr = null

   return on

  get_object: (p) ->
   if p < 0 or p >= length
    return null
   find p
   arrays[findRes[0]].get_object findRes[1]

  set_object: (p, obj) ->
   if p < 0 or p >= length
    return off
   find p
   arrays[findRes[0]].set_object findRes[1], obj

  get_prop: (i, prop) ->
   if i < 0 or i >= length
    return null
   find i
   allViews[findRes[0]][prop][findRes[1]]

  set_pro: (i, prop, val) ->
   if i < 0 or i >= length
    return off
   find i
   allViews[findRes[0]][prop][findRes[1]] = val
   return on

  get_lastViews: -> lastViews
  get_allViews: -> allViews
