def to_base_2(x):
    """x is a positive integer. Returns a list that is x in base 2.
    For instance, 22 becomes [1, 0, 1, 1, 0] and 0 becomes []"""
    x = int(x)
    result = []
    while x > 0:
        if x % 2:
            result.append(1)
        else:
            result.append(0)
        x = x // 2
    result.reverse()
    return result