Tag Selected: the algorithm