def points_to_path(points, closed=True):
    """turn a series of points into a path"""
    first = True
    data = "M "
    for point in points:
        if not first:
            data += " L "
        data += f"{point[0]},{point[1]}"
        first = False
    if closed:
        data += " Z"
    return data