Example of code using bit masking functions