Working on cycle detection