def listify(x):
    """ allow single item to be treated same as list. simplifies loops and list comprehensions """
    if isinstance(x, tuple):
        return list(x)
    if not isinstance(x, list):
        return [x]
    return x