Update cap.cpp