refactored submit_tag.py script