added function templates (generics)