Rearranged code to have function that takes initial guess of minimum distance location and only uses that guess as the starting point for the NRS solver.