Created the filter for tags.

Also added a test fort the filter function