Implemented efficient bitmask question generator