Minor changes to catcote template, and changed udf_functions to define an array as $var = Array(); rather than $var = []; as it did not work on a different version of php on my commercial web host.