add tag() function and a test for it