Update c++ file to include sum