Merge change 187 into donut

* changes:
  replaced integer * and % with shift operations, for performance