alternate implementation of boolean masking, might be easier to addapt for subfeatures