implemented log2