added different way to do function as well as tests