generalizing the functions
generalized functions seem to be working