Solved finding loop in linked list