updated implementation of list.