changing LinkedList type to List