utility function to init a vector