Added a polygon test when inserting new points to the tree