Added some polygon detection