adds ability to mask segmentation