Moved to using linear search algorithm as it is more robust under degene...

...rate knots