coroutine for judging