Implemented a helper function.