working example of more than one pair of segments