user-defined function supported, tested.