title: Scheme max on sub lists
body: <p>I've written a function to get the maximum value from a list of nested lists, I have the general form of the function down right; it works on flat lists and nested lists but seems to fail when there are sibling nested lists.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>(define (multi-max array)
    (cond
      ((null? array) 0)
      ((number? (car array))
        (if (&gt; (car array) (multi-max (cdr array)))
         (car array)
         (multi-max (cdr array))))
      ((pair? (car array))
       (multi-max (car array)))
      (else
       (multi-max (cdr array)))))
  </code></pre>
  
  <p>Here is a test list that it fails on: <code>(multi-max '(1 9 83 9 (332 (334) (2 3 4224))))</code></p>
  
  <p>I'm not sure where I'm going wrong, logically, some help would be nice!</p>