Make a separate function for closest power of 2.