changed to hana for checking whether polygon is valid