Update tsp.py

misc code clean up