added log2 macro