added a helper function