replace std::vector with DyanmicArray