direct_sum.cc update. Final version.