python3 compatibility restored. finished work on tsp_ads