refactored tags, added a new method for merging tags