use array to store vector elements