Dynamic array implementation