def highest_bit(count):
    """Which is the nost significate bit in the binary number "count" that has been
    set? 0-based index"""
    highest_bit = -1
    for i in range(0,32):
        if (count & (1<<i)) != 0: highest_bit = i
    return highest_bit