title: number_in_month exercise (Iteration over multiple lists in SML)
body: <p>I am having two lists in SML, lets say list A <code>[(a,b,c),(d,e,f)]</code> and list B <code>[b,e]</code>. I want to count how many occurrence of each item in B that matches the second element of each triple in A. The output should be 2. Because <code>b</code> and <code>e</code> each occurs once in A. </p>
  
  <p>This is my code so far but my counter is always set to 0 when I move from one element to another in B. I know in Java this will just be a simple double for loop. </p>
  
  <pre><code>fun number_in_months (d : (int * int * int ) list, m : (int) list) = 
      if null m then 0 
      else if null d then number_in_months(d, tl m)
      else if (#2(hd d)) = (hd m) then 1 + number_in_months (tl d, m)
      else number_in_months(tl d, m)
  </code></pre>