added alternate flows for when no path is found within 10000 iterations or no path exists