add_count function

Add a count column to the data frame