updated helper functions