use vector, avoid memory allocation