working tsp.py