modify diameter.cpp