Calculate Sum of nodes