added pts[5] calculations on distance from initial point