measuring and constructing segments