Simply and fix tdk.py