Added the method add-tag and its test.
Reused a variable instead of regenerating it.