Removed duplicate points from the polygon. Fixed the subdivision logic.