add user-defined function