Simplified version of calc_sum