update isInPolygon function, to be tested