working on merging runAutoGroup functions