generate groups script