Edited for handling cycle