Updated linked list code