I am having trouble with a template, the order in which the points are being connected is out of sequence and does not follow the constraints. It actually seems to be following the order of point selection when using the NEXT and PREVIOUS buttons in the…