rotated linked list bug fix