generalized the supplied functions