Included Segmentator/Pseudocode I started from