implemented bitwise operation for check if a given number is a power of 2