added memory-efficient array resize features