Fixed all the things.  Algorithm to find the minimum total distance works, to a degree.  It may not find the optimum every time. Refactored most of the variable names.