Tag Selected: how does the algorithm work