replace simple array with std::vector