Changed bounds on the segmenter loop because is was cutting off a point on each new segment.  Changed subsegment method.  Bounds were wrong on newdata array and forgot to actually replace data with newdata so fixed both of those.