def area(pts,absolute=False):
    """    
    Computes the clockwise area of the polygon defined by the points.

    Parameters
    ----------
    pts : list of (x,y) tuples 
        The coordinates of a polygon. 
    absolute : bool
        Flag indicating if return value must be a positive number.
    Returns
    ----------
    float
        The area of the input polygon.
    """
    # uses shoelace formula (surveyor's formula)
    # check to see if polygon closes; if not, then force it to close
    if pts[len(pts)-1] != pts[0]:
        pts.append(pts[0])
    # calculate areas of each trapezoid
    a=[(pts[i+1][0]-pts[i][0])*(pts[i][1]+pts[i+1][1]) for i in range(len(pts)-1)]
    # sum areas and divide by 2
    A=sum(a)/2
    # handle request for absolute value
    if absolute:
        return abs(A)
    else:
        return A