added bitmask impl