Working on a function to do all the tag grouping.
Working on making it more modular.