Adding bitwise functionality

Bitwise operators are very useful for efficiency.

All the code has division by 2 and power of 2, and adding bitwise operator could improve the functionality, but being careful with negative power of 2.