log2 computation uses an algorithm from the bit twiddling hacks site now