added the finder of the endex of the min point
ithere