Made segmentString be smarter