BaseMask occupies the lowest bits. Effect of applying the mask is neutralized by right shift operation, thus making it useless.
Also change mask init value from hex to bin since it's more natural for mask.
Fix: Remove a redundant bitwise operation.
P.S. It hurts my eyes everytime I see it. I gave up.