improve the cycle method of ListNode