conversion of chaning from linked list implementation to vector.