Added algorithm to determine best route