Implementation of a linked list and operations on it