Smooth out memory allocation by using a vector.