Added more tagging logic