now have a polygon class which works