segmentation code to show in defense