compacted example ifs