Converted UDF library sample