Better logic for adding conditional cells