Changed the function arguments of bestPointOnPath