reduce log2 to log calls