switched over to 32 bit masking instead of crazy looping