switched logic around 

to bitmasking easier to understand