MADE:
--> Completed segmentation function

TODO: