How to stop optional sections from printing?