tsp: 2nd solution, seems ok