refactor
linked list cycle