added if generation