Added tagging subroutine