extremely dirty fix for TSP. should work though