Adding code to see if a tree is balanced