use std::vector for double* access