Add a bitmask and logic to check individual bits