Added function to get_segment
Continued