Add rank field to tagged end

At the moment it is not used during matching,
so behavior does not change yet
Rank tags during matching

Tag with lower rank number wins