Restored treeAggregate
Used return to avoid indentation
Formatting