fine tunning the logic to fit the twists and turns of the routes