bitmask machinery