added overlayGroups parameter across all necessary functions