Updating bitmasks