cleaned up tgroup.c