added linked list helper functions