Working prototype of TSP with callbacks