add functions for managing trial groups.