use coroutine concept to generate combinations