add and use a dictionary for storing the number of iname references.