def flatten(array):
    """Flattens a list of lists.
    e.g. [[1, 2, 3], [4, 5, 6]] --> [1, 2, 3, 4, 5, 6]
    """
    flat = []
    for element in array:
        flat.extend(element)
    return flat