Added a lot of changes, especially to triangulate complex polygonal domains