FYI, it is much more efficient to allocate an array with double the current size when the limit is reached. This is because each time you allocate a new array, you have to first find the memory space...