adding program to check if tree is balanced