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
Merge pull request #1 from alekibango/patch-1

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