Finished tree_sum()