Created class handling linked list