generalization of some functions