public boolean inOrder(TreeNode root, Integer preVal) {
        
        if (root == null) return true;
        
        if (!inOrder(root.left, preVal)) return false;
        
        if (preVal >= root.val) {
            return false;
        } else {
            preVal = root.val;
        }
        
        if (!inOrder(root.right, preVal)) return false;
        
        return true;
    }