power of two recursive version, and bitwise version working