conversion of chaining implementation from linked-list to vectors.