correcting end points in 3D visualization