code to calculate the next highest power of 2