add testing mode for build_groups()