implemented static getPowerOfTwo function