add the family group function

as usual, there are some bugs need to be fixed.