segment.cpp