Did you need this ">>> 0" to get it to work? I don't see how it would add anything. As soon as you use the variable below in bitwise context it goes back to a signed int.