Improved tree printing method, added isBalanced example