debugging findOptimalRoute method