linkedlist:adjusted the function signature