Add function to count number of unique names, etc