Added entire path as a very transparent line. Reduce repeated code, changed variable names. Modified z value in distance calculation.