working on tagging logic