added algorithm for optimizing a polygon to a given area