spiffed up tagging code