added user defined function template