Make loop only less than numPowersOf2