corrected @param for function and what parameters get passed into the function.  Add close file commands at end of function (outside the loops).
https://app.asana.com/0/19128794071925/19594215856460