Update cal.cpp

included a new add function