Completed naive TSP implementation