Yet another approach, trying to reduce code replication. Adds two columns to the data: repeated identifiers, and total num of repetitions