fixed it up to remove the helper function