The rules actually require a single UDF, one of the reasons I didn't look at coding as it makes the whole thing far more complicated and I knew I wouldn't get time to get a working result:

quote:
All functionality of the UDF must be contained within the FUNCTION/ENDFUNCTION commands. You are not allowed to call code located outside the UDF.
quote:
  • The UDF should be self-contained (except for any I/O mentioned in the challenge). In particular, you may not do things like fetching extra data from a remote site.
  • You are not allowed to use additional code that is external to the MOAN UDF. All code must be contained within the MOAN UDF.