refactored nearest, higher power of 2 calculation