copy paste of the navigation code, to differenciate the mode=2 cases to the rest