public int visit(TreeNode node, int depth){
    	int left = depth, right = depth;
		if(node.left != null)left = visit(node.left, depth + 1);
		if(node.right != null)right = visit(node.right, depth + 1);
		if(left - right > 1 || left - right < -1) balanced = false;
		return (left > right) ? left : right;
    }