Better calculation of power of two