let num_groups:int list ref   = ref []