added conditionals to measure different segment stripes