Upgraded `textgrid.py`