rearanging functions in tag_parser.py