Added travelingSalesman function

Not sure if it's the most efficient way to do things, so I may change it later but it should get the job done.