More work on masking classes; added second template parameter...