Update tagging algorithm