functions to perform certain activies in a linked list