2% speed increase by converting modulus to mask on power of 2