Create Efficient way to detect and remove loop from singly linked list