Use bitops instead of div/mod