Added a helper function