Updated functions for tagging