tagging functions. Need to deal with repeats