Update calculate.cpp