Clearing bits and using masks