added template forms to define functions in library