added template functions