exercise 2.48 segment constructor and selectors