Coroutine logic

Coroutine logic : first attempt