@staticmethod
def nBits8(num):
    """
    counts the number of bits in a number
    """
    count = 0
    for i in range(8):
        if num & 1 == 1:
            count += 1
        num >>= 1
    return count
