substitute math.log2 for more compatible log(x, 2)

math.log2(x) is not available for some python versions, 
math.log(x, 2)  works everywhere