enhanced Resize() to allocate maximum number of elements possible instead of the overflow