adding is_power_of_two function using bit manipulation