edit R functions for cleaner family specification