use a TreeMap for storing tags so they're sorted