working on for loop in list function for the linked-list.