pointInsidePolygon function implemented