added function to calculate sum of all binary tree elements