linked list related code