Added custom datalog functions