added and implemented the linked list version