Update segment.cpp