Simplified cycle detection one more time.