helper function added
about to merge