Implemented the linked list structure for handling.