finish mappedsegment first draft.  time to debug...