add coroutine manager code from tutorial