Updated tft.py to current working version