Updated is_power_of_2 function. Old one was incorrect