Uninitialized i used incorrectly in tsp()