fixed bug with finding largest set of matching tags