I want to return the sum of values of all the left leaves in a tree but it seems that values in my "total" variable are being lost when it returns back to the call