function solving tagslist