added the tag encoder