implements condition for generation