changed calls of log2() to log(...,2) for compatability with python<3.3