added template function