add countLeadingZeros() function