detecting polygons
todo