Make isNeighbor const
Fix polygon generation