Added line split in polygon code