Look at the example in the header of the UDF.