updates linked list