tag groups updated

check for downcase version of tag and use ‘split’ instead of ‘replace’
to make tag case irrelevant when outputting