Created polygon check intersection function