def polygon_area(polygon):
    """
    Computes the area of a polygon.
    polygon: list of tuples representing points (x, y).
             first and last point should be the same.
    return: the polygon area
    """

    w=0
    for count in range(len(polygon)-1):
        y = polygon[count+1][1] + polygon[count][1]
        x = polygon[count+1][0] - polygon[count][0]
        z = y * x
        w += z
    return abs(w/2.0)