changed interface of segments to vector<double>