    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

   i_lastArr++
   i_lastPos = 0

 #functions for individual getters and setters
 for k, i in struct.titleKeys
  do (i) ->
   ArrayListClass.prototype["set#{k}"] = (p, val) ->
    find p
    allViews[findRes[0]][i][findRes[1]] = val
    null

   ArrayListClass.prototype["get#{k}"] = (p) ->
    find p
    allViews[findRes[0]][i][findRes[1]]


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

 #find = find_inline
 ###
 # linear find is faster for small number of arrays
 # binar search should be used after
 #
 #P.S. This seems to be of no use. Having binary search for all cases
 ####
 find_hybrid = (p) ->
  if p < MAX_LINEAR_FIND_INDEX
   find_linear p
  else
   find_binary_search p

 find = find_binary_search

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