implemented helper functions