def bits_to_array(num, output_size):
    """ Converts a number from an integer to an array of bits
    """

    ##list(map(int,bin(mushroom)[2:].zfill(output_size)))

    bit_array = []
    for i in range(output_size - 1, -1, -1):
        bit_array.append((num & (1 << i)) >> i)
    return bit_array