FIX: solution invalid if polygons self-intersect or are flipped