Made changes to display if a cycle was detected