optimize flying route when plane is near an exit