def chunks(l, n):
    """
    Split list into chunks.
    source: http://stackoverflow.com/a/1751478

    :param l: list to split
    :param n: chunk size
    :return: [[],[],[],...]
    """
    n = max(1, n)
    return [l[i:i + n] for i in range(0, len(l), n)]