Cleaned up the tag output routine based on suggestions from kljohann